Acrobat PDF

Bash VI Editing Mode (readline) Cheat Sheet

You must be logged in to download this document
Reviews
Bash VI Editing Mode (readline) Cheat Sheet
Rated 9 out of 10

April 09, 2008 (1 years 2 ago)
Pretty good collection!!! Might have taken a good amount of hands on to comprise all this. Many of them were known things but coders don’t bother to use them. A very helpful guide for coders. My take out from this list is CTRL-w and CTRL-u commands. I didn’t have even a vague idea about their existence. Good work!!!

Shared by: Peteris Krumins
Stats
views:
7450
downloads:
88
rating:
6.6(3)
reviews:
1
posted:
1/10/2008
language:
English
pages:
0
Readline VI Editing Mode Cheat Sheet Default Keyboard Shortcuts for Bash Shortcut Switching to Command Mode: Description Switch to command mode. Insert before cursor. Insert after cursor. Insert at the beginning of line. Insert at the end of line. Change text of a movement command (see below). Change text to the end of line (equivalent to c$). Change current line (equivalent to 0c$). Delete a single character under the cursor and enter input mode (equivalent to c[SPACE]) . Replaces a single character under the cursor (without leaving command mode). Replaces characters under the cursor. Edit (and execute) the current command in a text editor (an editor in $VISUAL and $EDITOR variables or vi). Move Move Move Move Move Move Move Move Move Move Move Move one character right. one character left. one word or token right. one word or token left. one non-blank word right. one non-blank word left. to the end of the current word. to the end of the current non-blank word. to the beginning of line. to the first non-blank character of line. to the end of line. to the corresponding opening/closing bracket (()’s, []’s and {}’s). ESC i a I A c C cc or S s r R v Commands for Entering Input mode: Basic Movement Commands (in command mode): l or SPACE h w b W B e E 0 ˆ $ % fc Fc tc Tc ; , | Character Finding Commands (these are also Movement Commands): Move right to the next occurance of c. Move left to the previous occurance of c. Move right to the next occurance of c, then one char backward. Move left to the previous occurance of c, then one char forward. Redo the last character finding command. Redo the last character finding command in opposite direction. Move to the n-th column (you may specify the argument n by typing it on number keys, for example, 20|). A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License. Deletion Commands: x X d D dd CTRL-w CTRL-u u U . y yy p P Commands for Command History: Delete Delete Delete Delete Delete Delete Delete a single character under the cursor. a character before the cursor. text of a movement command (see above). to the end of the line (equivalent to d$). current line (equivalent to 0d$). the previous word. from the cursor to the beginning of line. Undo, Redo and Copy/Paste Commands: Undo previous text modification. Undo all previous text modifications on the line. Redo the last text modification. Yank a movement into buffer (copy). Yank the whole line. Insert the yanked text at the cursor (paste). Insert the yanked text before the cursor. Move backward one command in history. Move forward one command in history. Move to the history line n (you may specify the argument n by typing it on number keys, for example, 15G). Search history backward for a command matching string. Search history forward for a command matching string (remember that on most machines CTRL-s stops the output to the terminal (CTRL-q starts output) and you might need to change it with stty command). Repeat search in the same direction as previous. Repeat search in the opposite direction as previous. List possible completions. Insert all possible completions. Invert the case of the character under cursor, and move a character right. Prepend # (comment character) to the line and send it to the history list. Inserts the n-th word of the previous command in the current line. Sets the numeric argument. Insert a character literally (quoted insert). Transpose (exchange) two characters. k j G /string or CTRL-r ?string or CTRL-s n N Completion Commands: TAB or CTRL-i or = * Miscellaneous Commands: ∼ # 0, 1, 2, ... CTRL-v CTRL-t Examples and Tips • Some of the commands take a . These commands apply the movement to themselves. For example, d$ would use $ as a movement, which moves the cursor to the end of the line, thus, the whole d$ would delete text from the current cursor position to the end of the line. Another example, a command cfA would use fA as a movement, which finds the next occurance of the character A, thus, the whole command would change the line up to character A. • Use CTRL-v to insert character literally, for example, CTRL-v CTRL-r would insert CTRL-r in the command line. • See man bash, man readline, and built in bind command for modifying the default behavior! A cheat sheet by Peteris Krumins (peter@catonmat.net), 2008. http://www.catonmat.net - good coders code, great reuse Released under GNU Free Document License.

Post this Doc to Twitter
Embed on any Website or Blog
Shared by: Peteris Krumins
About
i love mathematics, physics and computer science!
Other docs by Peteris Krumin...
Set Operations in Unix Shell
Views: 118  |  Downloads: 13
Bash Shell History Editing Cheat Sheet
Views: 872  |  Downloads: 24
Perl Pack Unpack Printf Sprintf Cheat Sheet Summary
Views: 1625  |  Downloads: 17
Ed, The Original UNIX Text Editor, Cheat Sheet
Views: 388  |  Downloads: 31
Sed, UNIX Stream Editor, Cheat Sheet
Views: 585  |  Downloads: 45
Bash Emacs Editing Mode (readline) Cheat Sheet
Views: 421  |  Downloads: 20
Screen VT100ANSI Terminal Emulator Cheat Sheet
Views: 458  |  Downloads: 12
Related docs
Trucos Linux
Views: 503  |  Downloads: 23
abs-guide
Views: 295  |  Downloads: 8
SAGEdoc
Views: 93  |  Downloads: 0
altos_g301_redhat_linux_8.0_installation_tips
Views: 393  |  Downloads: 0
Shell Programming
Views: 213  |  Downloads: 8
Some Useful Linux Commands
Views: 454  |  Downloads: 66
unix_book
Views: 483  |  Downloads: 35
intro-linux[2]
Views: 1284  |  Downloads: 15
Alzola+Harrell-Hmisc-Design-Intro
Views: 174  |  Downloads: 1
_ebook_ linux security
Views: 254  |  Downloads: 14
StarOffice
Views: 61  |  Downloads: 0
Bash-Prog-Intro-HOWTO
Views: 146  |  Downloads: 5
Bash-Prompt-HOWTO
Views: 71  |  Downloads: 3
Battery-Powered
Views: 124  |  Downloads: 0
Path-HOWTO
Views: 101  |  Downloads: 0