Grimoire-
Command
.es

GNU+Linux command memo

Usefull shell default key shortcuts

In Bash and ZSH default key shortcuts are emacs style, a vim style exists.

20 raccourcis clavier du shell (Bash, ZSh) en mode emacs le réglage par défaut. Un mode vim existe.

1. Controlling processes

Keys

Description

CTRL+C

Close the process running in foreground

CTRL+Z

Suspend current process, it goes Zzz
bg command to resume it in background,
fg command to resume it in foreground.

2. While typing commands

Keys Description

CTRL+R

Recall a previous command

TAB

Auto-complete files and folder names, also commands and options with ZSH

CTRL+C

Clean the line

3. Correcting text

Keys Description

CTRL+_

Undo the last key press. Can be repeated.

CTRL+T

Toggle the last 2 characters;
Alt+T the last 2 words;
Esc+T current word with previous

4. Moving

Keys Description

CTRL+A

Go to the begining of the line (like Home) alpha

CTRL+E

Go to the end of the line (like End)

Alt+F

Move 1 word forward, CTRL+F 1 character

Alt+B

Move 1 word backward, CTRL+B 1 character

5. Cut / paste

Keys Description

CTRL+H

Cut 1 char before the cursor (like Backspace)

CTRL+W

Cut 1 word before the cursor

CTRL+U

Cut the part of the line before the cursor (Undo)

CTRL+K

Kut the part of the line after the cursor

CTRL+Y

Paste (yank) the last cut string

6. Controlling the terminal

Keys

Description

CTRL+S

Stop the current output (to read it)

CTRL+Q

Quit suspended mode, so resume output.
PgUp to read the begining [1].
<cmd> | less to control output from start.

CTRL+L

Clear shell screen, like clear command. Redraw layout [2]

CTRL+D

Exit (destroy) the current shell

7. Bonus

Keys Description

CTRL+M

Alternative to Enter
CTRL+J also works


1. CTRL + A Esc ↑ in a screen, Esc to stop
2. Redraw screen in many console-based app.