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

Sending desktop notifications

At a specific time

echo 'notify-send "notification text"' | at hh:mm

After n minutes, hours, days, or weeks

echo 'notify-send "notification text"' | at now + n unit

Making the notification more (or less) annoying

Use the -u flag:

notify-send -u "notification text" level # level: critical|normal|low

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

Text processing

Removing the diabolical non-unix newline characters

tr -d '\r'