mirror of
https://github.com/xmengnet/the-art-of-command-line.git
synced 2024-12-24 03:36:29 +08:00
parent
610c8ac5bb
commit
54878c375b
1 changed files with 4 additions and 1 deletions
|
@ -74,7 +74,10 @@ Notes:
|
|||
|
||||
- In Bash, use **ctrl-w** to delete the last word, and **ctrl-u** to delete all the way back to the start of the line. Use **alt-b** and **alt-f** to move by word, **ctrl-a** to move cursor to beginning of line, **ctrl-e** to move cursor to end of line, **ctrl-k** to kill to the end of the line, **ctrl-l** to clear the screen. See `man readline` for all the default keybindings in Bash. There are a lot. For example **alt-.** cycles through previous arguments, and **alt-*** expands a glob.
|
||||
|
||||
- Alternatively, if you love vi-style key-bindings, use `set -o vi`.
|
||||
|
||||
- Alternatively, if you love vi-style key-bindings, use `set -o vi` (and `set -o emacs` to put it back).
|
||||
|
||||
- For editing long commands, after setting your editor (for example `export EDITOR=vim`), **ctrl-x** **ctrl-e** will open the current command in an editor for multi-line editing. Or in vi style, **escape-v**.
|
||||
|
||||
- To see recent commands, `history`. There are also many abbreviations such as `!$` (last argument) and `!!` last command, though these are often easily replaced with **ctrl-r** and **alt-.**.
|
||||
|
||||
|
|
Loading…
Reference in a new issue