This is the most commonly used sequence. In the bash shell, CTRL-C will terminate any currently running process and return you to the bash prompt. For example, if you accidentally run a command that does not stop, use CTRL-C to cancel the command.

Many Unix commands read their input directly from the keyboard. An example is the WC command. WC counts the number of lines, words and characters that a user types in from the keyboard. So if you tpye WC at the command prompt, the command will wait for your input till you use CTRL-D to signal the end of transmission.

CTRL-Z means to suspend a program. For example, you are working with a command and you want to stop it temporary as it is taking too long. To do that, you can use CTRL-Z. You can later restore back the command using the fg command.

If you have messed up a certain command and you want to start all over, instead of using backspace, you can use CTRL-U. CTRL-U resets the current line.

Instead of using the backspace key, you can use CTRL-H to function the same way. Unless the backspace key is malfunctioned or mapped wrongly, this sequence serves very little purpose.

Freeze your screen. This is a good command to use if you decide to go for a coffee break and do not want any process to run till you are back.

This sequence is exactly the opposite to CTRL-S. If you have freezed the screen before, you use this command to unfreeze it.

Functions the same way as the RETURN key.

Makes a terminal beep sound for fun and entertainment.

Go to the beginning of the line (note that if you use GNU screen, you can use the Home button to do
this, especially considering that Ctrl‐A is a special control character in screen).

Go to the end of the line (note that if you use GNU screen, you can use the End button to do this).

Alt‐B (or ESC, left arrow)
Jump back one word using a non‐alphanumeric character as delimiter.

Alt‐F (or ESC, right arrow)
Jump forward one word using a non‐alphanumeric character as delimiter.

Ctrl‐PGUP or Shift‐PGUP
This may or may not work, and it works differently on different console apps. It will either scroll up one line at a time, 1 page at a time, or it may not work at all. I'm inclined to think it's not a bash shortcut at all.

Ctrl‐PGDN or Shift‐PGDN
Same as the above but scrolling is done in the opposite direction.

Previous/Next command in history. This one is way too obvious but I'm including it for completeness.

History search. For example, Ctrl‐R svn Ctrl‐R Ctrl‐R … will cycle through all recently run commands with the ‘svn’ in them. It is one of the most useful shortcuts in bash.

Cut one word backwards using white space as delimiter.

Cut one word backwards using a non‐alphanumeric character as delimiter (different from Ctrl‐W, for example, abc;bcd will cut to abc;).

Cut everything forward to end of line.

Cut everything backwards to beginning of line.

Transpose the current character with the previous one. I almost never use this. Never mind, I never use it, but someone might find it useful.

Transpose the word at cursor with the one before cursor. In other words, swap them around.

Paste whatever was cut by the last cut command.

Insert the next character literally. For example, Ctrl‐V TAB inserts the actual TAB character. This shortcut is often misunderstood because of mistyping Ctrl‐V and not realizing what it does.

Undo the last command. Don’t forget – it’s Ctrl‐Shift‐MINUS, not Ctrl‐MINUS.

Revert all changes to current line. Very useful if you accidentally modify a command in history.

Uppercase/lowercase/capitalize from cursor to end of word and move cursor past end of word.

Clear screen while keeping whatever is already typed in the command line intact.

Autocomplete. Start typing, then hit TAB. You will either get a list of possible completion values (2 TABs needed) or the only choice will be filled in (only 1 TAB is needed). This shortcut is quite obvious and well known, so I put it at the bottom of the list.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License