DEV Community

Cover image for Essential Shortcuts for Linux Terminal 2024 ๐Ÿ’ฅ
DevOps Descent
DevOps Descent

Posted on • Edited on

Essential Shortcuts for Linux Terminal 2024 ๐Ÿ’ฅ

Master key ๐Ÿ”‘ Linux ๐Ÿ’ป shortcuts to streamline your workflow and boost command-line efficiency in 2024. From navigation to process management, these shortcuts enhance productivity and make terminal tasks smoother.

Essential Linux Shortcuts for 2024

Image description

Terminal Navigation Shortcuts ๐Ÿ’ป

  • Ctrl + A โ€“ Move cursor to the beginning of the line.
  • Ctrl + E โ€“ Move cursor to the end of the line.
  • Ctrl + U โ€“ Cut everything from the cursor to the beginning of the line.
  • Ctrl + K โ€“ Cut everything from the cursor to the end of the line.
  • Ctrl + W โ€“ Delete the word before the cursor.
  • Alt + B โ€“ Move cursor backward by one word.
  • Alt + F โ€“ Move cursor forward by one word.
  • Ctrl + Y โ€“ Paste the last cut text.

Image description

Command History Shortcuts

  • Ctrl + R โ€“ Reverse search in command history.
  • Ctrl + G โ€“ Exit from history searching mode.
  • !! โ€“ Repeat the last command.
  • !n โ€“ Run the command with line number n from history.
  • !string โ€“ Run the last command starting with "string."

Image description

Process Management Shortcuts

  • Ctrl + Z โ€“ Suspend the current process.
  • Ctrl + C โ€“ Kill the current process.
  • Ctrl + D โ€“ Logout or end the terminal session.
  • jobs โ€“ List all running jobs in the background.
  • fg โ€“ Bring a background job to the foreground.
  • bg โ€“ Resume a suspended job in the background.

Image description

File and Directory Management Shortcuts

  • Tab โ€“ Autocomplete file or directory names.
  • Alt + . โ€“ Insert the last argument of the previous command.
  • Ctrl + L โ€“ Clear the screen (similar to clear command).
  • !! > file.txt โ€“ Repeat the last command and redirect output to a file.

Image description

Text Editing Shortcuts

Image description

  • Ctrl + Left/Right Arrow โ€“ Move left or right by one word in the line.
  • Ctrl + Backspace โ€“ Delete the previous word.
  • Ctrl + Shift + C โ€“ Copy selected text in the terminal.
  • Ctrl + Shift + V โ€“ Paste text into the terminal.
  • Shift + Insert โ€“ Paste text (alternative for Ctrl + Shift + V).

Image description

Miscellaneous

  • Ctrl + S โ€“ Freeze the terminal output.
  • Ctrl + Q โ€“ Resume terminal output after freezing.
  • Ctrl + T โ€“ Swap the last two characters before the cursor.
  • Ctrl + X, Ctrl + E โ€“ Open the current command in the default editor for easier editing.

Support if you found this helpful๐Ÿ˜‰

No Money ๐Ÿ™…๐Ÿปโ€โ™€๏ธ just Subscribe to me YouTube channel.

Linktree Profile: https://linktr.ee/DevOps_Descent
GitHub: https://github.com/devopsdescent

Top comments (11)

Collapse
 
gahuber95 profile image
Gary Huber

I've been using Linux for 30 years, and I never knew of these shortcuts, although they appear to be same as in emacs. Thanks!

Collapse
 
randodevguy profile image
Rando DevGuy

They are emacs keybindings. In bash, they are active when the environment variableEDITOR=emacs or FCEDIT=emacs, or set -o emacs has been run. There is also a set of vi compatible keybindings, used when set -o vi has been run.
See "man bash" then search for "Readline Key Bindings".

Collapse
 
devops_descent profile image
DevOps Descent

Well, I hope these will make help you somewhere ๐Ÿง˜

Collapse
 
david_j_eddy profile image
David J Eddy

Super helpful, earned my YT sub.

Collapse
 
devops_descent profile image
DevOps Descent

Thanks ๐Ÿฅฐ

Collapse
 
ddivyasharma profile image
DdivyaSharma

Thanks for this! Iโ€™ll try freezing the terminal before leaving my desk so no one can show their creativity on it ๐Ÿ˜†

Collapse
 
devops_descent profile image
DevOps Descent

Hope it will be fun.๐Ÿ˜„

Collapse
 
luis_gamurillo_e826946fb profile image
luis ga murillo

Todos muy lindos pero ninguno para abrir la terminal?

Collapse
 
devops_descent profile image
DevOps Descent

Los atajos son para quienes saben cรณmo usar Linux.๐Ÿ˜„

Collapse
 
skuarch profile image
Alfredo Bello

subscribed, thanks!

Collapse
 
devops_descent profile image
DevOps Descent

Thanks for the support ๐Ÿค—