Living in the Bash shell, memorize the shortcuts, will greatly improve your command-line operation efficiency.
Edit command
- Ctrl + a: Move command line first
- Ctrl + e: move the end of the command line
- Ctrl + f: Press the characters forward (to the right)
- Ctrl + b: After pressing the character move (to the left)
- Alt + f: forward (to the right) by word
- Alt + b: Press after the word move (to the left)
- Ctrl + xx: move the cursor between the command and the beginning of the line
- Ctrl + u: delete from the cursor to the first command line
- Ctrl + k: Remove from the cursor to the end of the command line
- Ctrl + w: remove prefix from the cursor to
- Alt + d: Remove from the cursor to the suffix
- Ctrl + d: delete the character at the cursor
- Ctrl + h: delete the character before the cursor
- Ctrl + y: stuck to the cursor
- Alt + c: Change capitalized first letter words from the cursor
- Alt + u: change from the cursor to all uppercase words
- Alt + l: change from the cursor to the word all lowercase
- Ctrl + t: exchange of characters before the cursor and
- Alt + t: switching a word before the cursor and
- Alt + Backspace: identical with Ctrl + w ~~ ~~ similar, some differences delimiter [rezilla correct thanks]
Re-execute the command
- Ctrl + r: reverse search command history
- Ctrl + g: Exit from the history search mode
- Ctrl + p: the history of the previous command
- Ctrl + n: the next command in history
- Alt +:. The final parameter on the use of a command
control commands
- Ctrl + l: clear screen
- Ctrl + o: execution of the current command, and select a command on
- Ctrl + s: stop screen output
- Ctrl + q: Allow screen output
- Ctrl + c: termination command
- Ctrl + z: Suspend command
Bang (!) Command
- !!: a command execution
- ! Blah: blah beginning with the most recent execution of commands such as ls!
- ! Blah: p: only print output without executing
- ! $: The last argument of the previous command, and Alt + same.
- ! $: P:! $ Printout of contents
- ! *: All parameters on a command
- ! *: P:! Printout of contents *
- ^ Blah: delete a command blah
- ^ Blah ^ foo: The last command is replaced blah foo
- ^ Blah ^ foo ^: The last command all the blah replaces foo