Useful commands

Terminal

Reload current shell in place (useful for cleanly applying recent shell config updates)

exec $SHELL

Show current shell level (increases when launching additional shells via bash, zsh etc)

echo $SHLVL

Clear the current screen of text

clear

Timing

Time current command execution and output user and system timing information

time <command>

Prevent sleep

Prevent computer from sleeping and declare user as active

caffeinate -u -t <seconds>

Other caffeinate options

  • -d Prevent display sleep

  • -i Prevent system idle sleep

  • -m Prevent disk idle sleep

Generate MD5 and SHA1 hashes

Generate MD5 hash from file

Generate SHA1 hash from file

Math utilities

General maths interpreter (allows general equations entered into command line)

Calculate result of math query using bc

Last updated