Command Line Tools
A very limited overview of what the bash shell can do to make your life easier via the command line (or prompt)
- To view the last 40 commands you typed in, look at the file .bash_history in your homedirectory.
- To scroll through the 40 commands you typed in keep using the "up arrow key"
A command can then be repeated by pressing enter. - Press
!!to repeat the last command. - Type
historyto view the commands you recently typed. Each command will have a number beside it. To repeat that command use its number preceded by an "!" as in !number - Use the tab key to complete the name of a command, type in the first letter or two and then press tab. If there is more than one command with that name the shell will over you a choice.
- Likewise if you are operating on files, pressing the tab key after typing the first few characters of the file and the name will be completed.
- Command Line Editing: Use the emacs key to edit the command line, Control-A to go to the start and Control-E to go to the end.
- Alias: Can't remember the name of a command, then use an alias to rename it to something you can remember. Or if the command is long and complicated use an alias to make it shorter. Type in
aliasto see which aliases we have already set up for you. To set a new one follow the syntax in the output. To set it up permanently you will need to add it to your startup files
Please email any suggestions, corrections, broken links, or errors to itweb [itweb