Linux: Most Important Keybinding for {Bash, Man, Terminal} ⌨
Xah Lee, ,
This pages show the most important keys for bash, man page, terminal app.
Bash Keys
These are the major keys of bash shell.
Moving cursor:
- 【Ctrl+b】 = backward a character
- 【Ctrl+f】 = forward a character
- 【Alt+b】 = backward word. Or 【Ctrl+←】
- 【Alt+f】 = forward word. Or 【Ctrl+→】
- 【Ctrl+a】 = move to beginning of line
- 【Ctrl+e】 = move to end of line
Deleting:
- 【Ctrl+h】 = delete backward 1 char
- 【Ctrl+d】 = delete forward 1 char
- 【Alt+⌫ Backspace】 = delete word backward
- 【Alt+d】 = delete word forward
- 【Ctrl+k】 = delete to end of line
Paste:
- 【Ctrl+y】 = paste. (deleted word or line can be pasted)
Search Command History:
- 【Ctrl+r】 = interactive search backward command history. (can press it multiple times)
- 【Ctrl+s】 = search forward command history
- 【↑】 = previous command
- 【↓】 = next command (after you pressed ↑)
Special, Job Control:
- 【Ctrl+l】 = clear screen (must be first input to prompt)
- 【Ctrl+d】 = exit shell (must be first input to prompt)
- 【Ctrl+c】 = terminate current foreground process (SIGINT)
- 【Ctrl+z】 = suspend current foreground process (SIGTSTP)
You can see most of special process control keys by stty -a.
Note: arrows keys, page up/down keys, home/end keys, usually work too, but not always.
By default, bash keys are the same as emacs's basic keys.
〔☛ Xah Emacs Tutorial〕
Bash keys can be customized in 〔~/.inputrc〕. See man readline. For a sample file of customized 〔.inputrc〕, see: System-wide ErgoEmacs Keybinding for Windows, Mac, Bash.
Keys for Viewing man pages
Here's the most important keys when viewing man page. Also works in paging programs such as “less”, “more”.
- 【f】 = page down.
- 【b】 = page up.
- 【h】 = show help.
- 【q】 = exit/quit.
- type
/‹string› = to search.
- 【n】 = next occurance.
- 【N】 = previous occurance.
These keys are similar to vi's keys. (not exactly compatible. For example, page down in vi is 【Ctrl+f】, not 【f】.)
〔☛ vi tutorial〕
Terminal App Keys
Here's most important keys in Gnome terminal. (You can see the full list under menu 〖Edit ▸ Keyboard Shortcuts…〗)
- 【Ctrl+⇧ Shift+c】 = copy.
- 【Ctrl+⇧ Shift+v】 = paste.
- 【⇧ Shift+⇞ Page △】 = page up the terminal screen. Mouse scroll wheel works too.
- 【⇧ Shift+⇟ Page ▽】 = page down the terminal screen.
- 【⇧ Shift+↖ Home】 = move to top of the terminal screen.
- 【⇧ Shift+↘ End】 = move to bottom of the terminal screen.
- 【Ctrl+⇞ Page △】 = Previous tab. (same as Firefox.)
- 【Ctrl+⇟ Page ▽】 = Next tab.
- 【Alt+1】 = switch to tab 1. (same as Firefox.)
- 【Alt+2】 = switch to tab 2.
- 【Ctrl+⇧ Shift+t】 = new tab.
- 【Ctrl+⇧ Shift+w】 = close tab.
System-Wide Screen Keys
- 【Ctrl+Alt+F1】 Switch entire screen to a text console mode, screen 1. F1 can be up to F6.
- 【Ctrl+Alt+F7】 Switch entire screen back to GUI mode.
System-wide, 【Alt+F2】 pops a run dialoge. In Xfce desktop, the command name is xfrun4.
See also:
blog comments powered by