Shell Shortcuts

May 24, 2019 1 min read

Getting good at using a command terminal and distancing yourself from GUIs is part of the rite of passage of becoming a programmer and has been something I’ve taken at a slow pace. Here are a few neat tricks I’ve learned when I joined Limejump.

My co-worker Aaron pointed me to the neat git lg alias that displays a coloured graphical log of the history of a repo, including fancy branching.

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

A few more shortcuts I’ve learned:

  • Ctrl+U deletes the current line

  • Ctrl+K deletes to the right of your cursor

  • Ctrl+A jumps to the beginning of the line

  • Ctrl+E jumps to the end of the line

  • !$ substitutes as the last argument of your previous command

  • !! repeats your last command

See Also

Last Updated: 2022-04-06 13:57