I tend to forget commands, especially when they get longer or more complex. That's when "history" gets handy. You might want to search in history,
Example:
$ history | grep shutdownThis will give you all shutdown commands from your history. You can also check command history, without running it.
1011 shutdown -h
1012 sudo shutdown -h now
Example:
$ !yourcommand:pOr if you need to execute multiple commands from history.
Example:
$ !219 ; !229 ; !221The last example is how to list your most used commands.
$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head