Published May 16, 2022 inLinux

33 Linux Terminal Shortcuts Every Power Linux User Must Know๐Ÿงตโ†“

avatar

By Traw

Welcome to my Social Blog

A novice Linux user may find the Linux terminal interface difficult to grasp, especially because it relies heavily on the arrow keys to move around. Furthermore, constantly retyping the commands, each with a slight variation, can be tedious.

Bash, on the other hand, includes a plethora of simple keyboard shortcuts and history functions that ensure efficient terminal use.

Having these terminal shortcut keyboard key combinations memorized will save you a lot of time.

To help you make better use of your time, I've compiled a list of the most commonly used Bash keyboard shortcuts.๐Ÿ‘‡

I'd like to point out that some of these shortcuts may be dependent on the Shell you're using. Because Bash is the most popular shell, the list is centered on it. I also tested the majority of them on ZSH and found them to be compactible.

๐Ÿ“œ Cursor Movement

โ†’ Ctrl + A Go to the beginning of the line you are currently typing on.

โ†’ Ctrl + E Go to the end of the line you are currently typing on.

โ†’ Ctrl + XX Move between the beginning of the line and the current position of the cursor.

โ†’ Alt + F Move cursor forward one word on the current line.

โ†’ Alt + B Move cursor backward one word on the current line.

โ†’ Ctrl + F Move cursor forward one character on the current line.

โ†’ Ctrl + B Move cursor backward one character on the current line.

๐Ÿ“œ Text manipulation

โ†’ Ctrl + U Cut the line from the current position to the beginning of the line, adding it to the clipboard. If you are at the end of the line, it cuts the entire line.

โ†’ Ctrl + K Cut the line from the current position to the end of the line, adding it to the clipboard. If you are at the beginning of the line, cut the entire line.

โ†’ Ctrl + W Delete the word before the cursor, adding it to the clipboard.

โ†’ Ctrl + Y Paste the last thing from the clipboard that you cut recently (undo the last delete at the current cursor position).

๐Ÿ“œ History access

โ†’ Ctrl + R Lets you search through previously used commands.

โ†’ Ctrl + G Leave history searching mode without running a command.

โ†’ Ctrl + J Lets you copy current matched command to command line without running it, allowing you to make modifications before running the command.

โ†’ Alt + R Revert any changes to a command youโ€™ve pulled from your history, if youโ€™ve edited it.

โ†’ Ctrl + P Shows last executed command, i.e. walk back through the command history (Similar to up arrow).

โ†’ Ctrl + N Shows next executed command, i.e. walk forward through the command history (Similar to down arrow).

๐Ÿ“œ Terminal/Process control

โ†’ Ctrl + L Clears the screen, similar to the clear command.

โ†’ Ctrl + S Stop all output to the screen. This is useful when running commands with lots of long output. But this doesn't stop the running command.

โ†’ Ctrl + Q Resume output to the screen after stopping it with Ctrl+S.

โ†’ Ctrl + C End currently running process and return the prompt.

โ†’ Ctrl + D Log out of the current shell session, similar to the exit or logout command. In some commands, acts as End of File signal to indicate that a file end has been reached.

โ†’ Ctrl + Z Suspends (pause) currently running foreground process, which return shell prompt. You can then use bg command allowing that process to run in the background. To again bring that process to foreground, use fg command. To view all background processes, use jobs command.

โ†’ Tab Auto-complete files and directory names.

โ†’ Tab Tab Shows all possibilities, when typed characters doesn't uniquely match to a file or directory name.

โ†’ Ctrl + S Gets the next most recent command

โ†’ Ctrl + O Runs and re-enters the command found via Ctrl + S and Ctrl + R

โ†’ Ctrl + G Exits history search mode

๐Ÿ“œ Bash Information

โ†’ ~TAB TAB List all Linux users

โ†’ Ctrl + I Completes the command like TAB

โ†’ Alt + ? Display files/folders in the current path for help

โ†’ Alt + * Display files/folders in the current path as parameter

๐Ÿ“œ Close Terminal

โ†’ Ctrl + Shift + W To close terminal tab.

โ†’ Ctrl + Shift + Q To close entire terminal.

That's for today's blog, be sure to try out these shortcuts and be amazed.

The shortcuts above are only a tip of an iceberg. The more you learn about Linux terminal commands and Bash shortcuts, the more simple and interesting Linux becomes.

If you found this blog valuable:


1. Toss me a follow for more threads on Linux and Security โ†’ @xtremepentest

2. Share so other Linux folks can find it too.

Comments