[โ€“] 9 points 1 year ago* (4 children)

I see everyone posting about Ctrl+R, here's a couple more useful CLI shortcuts you might enjoy:

cd - (change directory to $OLDPWD usually the previous directory)

git checkout - (similarly checkout the previous branch)

Ctrl+A (return caret to beginning of command, great when you forgot a positional argument and you were almost done typing the command)

Ctrl+E (similar to Ctrl+A but move to the end of the command)

  • source