Useful Shortcuts
Arrow Keys:
The UP and DOWN arrow keys allow you to scroll through the previously typed commands. If you make a typo, or frequently use the same command, this will save typing time.
The RIGHT and LEFT arrow keys, and the BACKSPACE allow you to edit the line you are on.
- Note: the mouse does NOT work in the terminal window
TAB Completion
You can use the TAB key to complete long filenames. Example:
I have a file called “this_is_a_very_long_filename” in my home directory. I would like to edit this file with Nedit. I can type “nedit this_is”, then hit TAB and the name fills automatically.
- Note: this works if only one filename starts with the characters you type
Chaining
To execute multiple commands on the same line, you can “chain” them together using a semicolon.
You are instructed to copy a file to your home directory, then to go to your home directory and confirm that the file has copied.
eos$ cp filename ~/; ls ~/
- Note: the commands will execute in the order they are typed. In the above example, if you receive an error on the second command, that means that the first command executed successfully and the computer stopped executing. It did not complete any commands after the error.
- Some students may be familiar with
&&
or||
for conditional chaining. Conditional chaining is a separate topic from just chaining. If you are asked to chain it means use the;
.
Clear the screen
You can type in the word clear to clear your terminal screen. This may be useful if there is too much information on your screen and you wish to have a clearer view of the terminal. You will not lose any information already typed, it will just scroll your prompt up to the top of the screen.
Keyboard Shortcuts
Ctrl + c is used to abort the currently running processes in terminal and return you to the command prompt if the system is “hung up.” This command will also abort any log file you may be working on, so avoid using this while the script
command is running.
Ctrl + z is used to stop a running application or process, and place it in the background. You can go back to the application by running fg