Here is a list of cheat-sheets that I created for utilities and programs I enjoy using.
Read More...
Bash Emacs Editing Mode Cheat Sheet
Bash’s default editing mode is Emacs. Here’s a list of the most useful shortcuts to help you navigate and edit the command line efficiently.
Cursor Movement
| Command | Description |
|---|
| C-a | Move to the beginning of the line |
| C-e | Move to the end of the line |
| C-b | Move backward one character |
| C-f | Move forward one character |
| M-b | Move backward one word |
| M-f | Move forward one word |
| C-l | Clear screen and redisplay the line |
Editing Text
| Command | Description |
|---|
| C-d | Delete the character under the cursor |
| C-h | Delete the character before the cursor |
| M-d | Delete the word after the cursor |
| M-DEL | Delete the word before the cursor |
| C-k | Kill from cursor to end of line |
| C-u | Kill from cursor to beginning of line |
| C-w | Kill the word behind the cursor |
| M-t | Transpose (swap) the last two words |
| C-t | Transpose (swap) the last two characters |
| C-y | Yank (paste) the last killed text |
Command History
| Command | Description |
|---|
| C-p | Previous command in history |
| C-n | Next command in history |
| M-< | Move to the first command in history |
| M-> | Move to the last command in history |
| C-r | Reverse search through history |
| C-s | Forward search through history (might be disabled in some terminals) |
Miscellaneous
| Command | Description |
|---|
| C-_ or C-x C-u | Undo the last editing command |
| C-x C-e | Edit the current line in an external editor (usually vi or emacs) |
| M-& | Run the previous command in the background |
| C-v or M-v | Insert the next character typed literally (e.g., allows input of control characters) |
Note: In this cheat sheet, C stands for the Control key and M stands for the Meta key (usually the Alt or Option key). Combining C or M with a character means pressing the Control or Meta key, respectively, while also pressing that character.
Read More...
The following is a short list of the most common keybindings for the screen terminal multiplexer.
| Command | Description |
|---|
| C-a ? | Get the screen help, and shows some keybindings |
| C-a c | Create a new window |
| C-a n | Switch to the next window |
| C-a p or Ctrl-a - | Switch to the previous window |
| C-a 0 to C-a 9 | Switch to window number 0-9 |
| C-a C-a | Toggle between the current and last window |
| C-a A | Rename the current window |
| C-a w or C-a " | Show a list of windows |
| C-a <Space> | Switch to the next region |
| C-a <Backspace> | Switch to the previous region |
| C-a <Tab> | Move to the next region |
| C-a S | Split display horizontally |
| C-a | or C-a V | Split display vertically |
| C-a Q | Close all regions except the current one |
| C-a X | Close the current region |
| C-a \ | Close current session |
| C-a :resize | Resize region |
| C-a :fit | Resize window to fit the terminal size |
| C-a :layout save <name> | Save current layout as <name> |
| C-a :layout load <name> | Load layout named <name> |
| C-a :layout next | Load next layout |
| C-a :layout prev | Load previous layout |
| C-a :layout title <title> | Set the title of the current layout |
Read More...
The following is a short list of the most common keybindings for the tmux terminal multiplexer.
Starting tmux
| Command | Description |
|---|
| tmux | Start a new session |
| tmux new -s name | Start a new session with a name |
| tmux a | Attach to the last session |
| tmux a -t name | Attach to a named session |
| tmux ls | List sessions |
Session Management
| Command | Description |
|---|
| C-b d | Detach from the current session |
| C-b $ | Rename the current session |
| C-b s | List sessions (navigate with arrow keys) |
Windows (Tabs)
| Command | Description |
|---|
| C-b c | Create a new window |
| C-b , | Rename the current window |
| C-b w | List windows |
| C-b n | Next window |
| C-b p | Previous window |
| C-b 0 to 9 | Go to window number 0-9 |
| C-b & | Close the current window |
Panes (Splits)
| Command | Description |
|---|
| C-b % | Vertical split |
| C-b " | Horizontal split |
| C-b o | Switch to the next pane |
| C-b ; | Toggle to the last pane |
| C-b x | Close the current pane |
| C-b [Space] | Toggle pane layouts |
| C-b q followed by a number | Quickly select a pane by number |
| C-b { or C-b } | Swap panes |
Misc Commands
| Command | Description |
|---|
| C-b t | Show the time |
| C-b ? | List all keybindings |
| C-b z | Zoom in/out on a pane |
| C-b [ and C-b ] | Enter/Exit copy mode |
| C-b : | Enter command mode |
Configuration
~/.tmux.conf is the configuration file for tmux. You can customize settings and keybindings there.
Read More...
Bash Vi Editing Mode Cheat Sheet
In Bash, you can switch to Vi editing mode with the command set -o vi. Here’s a collection of the most useful shortcuts in Vi mode.
Modes
In Vi mode, you start in “command mode” where you can navigate and manipulate text but cannot insert new text. To insert or append text, you’d enter “insert mode.”
| Command | Description |
|---|
Esc | Enter command mode |
i | Enter insert mode (before cursor) |
I | Enter insert mode (beginning of line) |
a | Enter insert mode (after cursor) |
A | Enter insert mode (end of line) |
R | Enter replace mode |
Cursor Movement
| Command | Description |
|---|
h | Move cursor left |
l | Move cursor right |
j | Move to previous command in history |
k | Move to next command in history |
w | Move forward one word |
b | Move backward one word |
0 or ^ | Move to beginning of line |
$ | Move to end of line |
Editing Text
| Command | Description |
|---|
x | Delete the character under the cursor |
X | Delete the character before the cursor |
dw | Delete word from cursor to word end |
db | Delete word from cursor to word start |
D or d$ | Delete to end of line |
d^ | Delete to beginning of line |
dd | Delete entire line |
u | Undo the last change |
Ctrl-r | Redo the last undo |
p | Paste text after cursor |
P | Paste text before cursor |
Command History
| Command | Description |
|---|
/ | Search backward in command history |
? | Search forward in command history |
n | Repeat the last / or ? command |
Miscellaneous
| Command | Description |
|---|
: followed by a command | Execute a command (e.g., :ls will run the ls command) |
v | Edit the current line in an external editor (usually vi or vim) |
Note: Always remember that you start in command mode in Vi mode. Use i, I, a, A, or R to enter different variations of insert or replace mode.
Read More...