This is a growing (but eventually, hopefully, shrinking) collection of shell commands I periodically need but have to look up every time.

Scheduling a shutdown

At a specific time

shutdown hh:mm

After n minutes

shutdown +n

Spring cleaning

Cleaning the Yay package cache

yay -Scc

Cleaning up the pip package cache

pip cache purge

Removing unused Python virtualenvs

Use Herb’s heroic interactive one-liner:

for filename in $(find . -path '*/bin/activate.csh'); do filepath=$(echo $filename | sed 's/\/bin\/activate.csh//g'); echo "Remove $filepath? (y/n)" ; read result; if [[ $result = "y" ]]; then rm -R $filepath; fi; done