Categories
Productivity Tips

Simple trick how to repeat last command in shell

Shells like Bash or Zsh have one neat feature: repeat last command. How to invoke it? Use double exclamation mark: !! This is very handy when you have typed the command as normal user, but it must be executed by sudo. Example: apt-get install safeq E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied) […]