See this page as a slide show
History
CS155 History
History
- Most shells keep a history of the commands you have used.
This history can be used to save time by searching for commands
that you’ve already typed in.
history
– list command history
- up arrow (↑), down arrow (↓) –
scroll up and down through history list
(might need to shift-up shift-down)
- There are ways to search for previous commands, but they depend
on your current “editing mode” (vi or emacs), so we won’t
discuss them here.
History Continued
- Several symbols exist to speed things up.
!!
– repeat last command
!a
– re-do last command that begins with a
!-2
– do the command two commands ago
- Pressing Tab while entering a path will attempt to complete the path
you have begun to type.
Modification
After you’ve summoned the old command using arrow keys,
you can modify it using arrows, backspace, and typing.
This is a great way to build up a command piece-by-piece.