The linux command line interface is a powerful tool and a professional alternative to a graphical user interface. The keyboard shortcuts listed here are essential to using the terminal efficiently.
In traditional computer documentation, the ^ symbol was used to indicate the Control Key. For example, ^C translated to Ctrl + C.
- ^C halts the current process. It can be used to interrupt a running process, stopping a server process, or getting a new terminal prompt to type on.
- ^D signals the End of File (EOF) character. It can be used to logout of a ssh or teletype (tty) session, to close a terminal window, to end a telnet session, or to signal the end of multiline input (standard input). Make sure it is the first character of a new line.
- tab attempts to autocomplete what you are typing. It works for file paths, program names, and occasionally command line switches. Press tab a second time to get a list of possible options, if more than 1 autocomplete is available.
- ^Z sends the current process to the background. You can use it to break out of a text editor, a less output, or top. Use jobs to show processes that are idling in the background. Then, use fg [job number] to return the process to the foreground.
- ^U deletes everything on the line before the cursor while ^K deletes everything on the line after the cursor. Together, ^U ^K (like United Kingdom) clears the whole line.
- ^L clears the whole terminal screen.
- reset resets the terminal to its original state.
- ^R starts the reverse-i-search, which searches your terminal history. It is useful for finding commands you have typed in the past.
- history gives you a list of recent commands you have typed. Use history|grep ssh to search for recent commands including the word ssh.
- # is the comment character. Terminal ignores everything on the same line after this character. Comments can help you remember what a command was for, or they can serve as memory points for the reverse-i-search.
- arrowup and arrowdown lets you go through the recently typed commands.
In some systems, Ctrl + Alt + T opens a new terminal. Ctrl + Alt + F1 all the way to F6 opens up teletype terminals. Ctrl + Alt + F7 returns you to the GUI.