Say I am in a bash terminal and have a large history of commands. I pressed the up arrow a whole bunch of times and am in the "middle" of the history. I want to now navigate to the first or the last command in my history quickly (without holding down the up or the down arrow for a long time). Is this possible? If so, what is the shortcut key to achieving this?
相关问题
- JQ: Select when attribute value exists in a bash a
- bash print whole line after splitting line with if
- “command not found” errors in expect script execut
- grep using grep results
- softlinks atime and mtime modification
相关文章
- Check if directory exists on remote machine with s
- Reverse four length of letters with sed in unix
- Compile and build with single command line Java (L
- Launch interactive SSH bash session from PHP
- BASH: Basic if then and variable assignment
- Bash script that creates a directory structure
- Test if File/Dir exists over SSH/Sudo in Python/Ba
- How can I create a “tmp” directory with Elastic Be
Take a look in the man page:
Here I copied for you the thing you were looking for:
Depending on how things are set up for your terminal, you can usually do a Ctrl+C to break you back to the beginning (no comment) and then go up once or twice to get to the recent command you want.
Alternatively, using the
history
command will list all the recent commands used with index values associated with them.!#
where#
is the index number will rerun that command. There's a nice usefulness of the commandhistory | grep [command]
to try and find a specific command in your history.