TIME-SAVING TIPS & TRICKS
It doesn’t matter how fleet of hand your typing skills are, the command line can still be a time-consuming, frustrating experience. Thankfully, the Terminal comes equipped with lots of handy time-saving shortcuts.
Here’s how to easily access previously used commands and view suggestions: Up/down arrows ................... Browse command history.
history .................................. View command history.
Ctrl-R ...................................... Search command history. Type letters to narrow down your search, with the most recent match displayed. Keep pressing Ctrl-R to view other matches.
Tab ........................................... View suggestions or auto-complete word or path if only one suggestion exists. Press ~ and Tab to autofill your username, @ and Tab to autofill your host name, and $ and Tab to autofill a variable. The following keys help you navigate the Terminal itself more efficiently: Home/End .............................. Press these to jump to the beginning or end of the
current line.
Ctrl-left/right cursor .......... Move quickly between arguments.
Ctrl-U ...................................... Clear the entire line to start again.
Ctrl-K ...................................... Delete everything from the cursor’s position onward. Ctrl-W ..................................... Delete the word before the cursor.
• Accidentally omitted sudo from your command? Just type sudo !! and hit Enter
to repeat the last command with sudo applied to it.
• If you make a typo when entering a command, instead of retyping the entire command, just use the following syntax to correct the mistyped word (in the following example, dpkg was originally mistyped as dkpg ): ^dkpg^dpkg