View profile

Linux Terminal Shortcuts Every Power Linux User Must Know

Traw
Traw
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, and the more you explore Linux terminal shortcuts, the easier and more interesting Linux will become.
To help you make better use of your time, I’ve compiled a list of the most commonly used Bash keyboard shortcuts.

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 the cursor forward one word on the current line.  
  • Alt + B Move the cursor backward one word on the current line.  
  • Ctrl + F Moves the cursor forward one character on the current line.  
  • Ctrl + B Move the 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, cut 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).  
- Alt + T Swap the last two words before the cursor.  
- Alt + L Make lowercase from cursor to end of word.  
- Alt + U Make uppercase from cursor to end of word.  
- Alt + C Capitalize to end of word starting at cursor (whole word if cursor is at the beginning of word).  
- Alt + D Delete to end of word starting at cursor (whole word if cursor is at the beginning of word).  
- Alt + . Prints the last word written in previous command.  
- Ctrl + T Swap the last two characters before the cursor.
  • 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, cut 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).  
  • Alt + T Swap the last two words before the cursor.  
  • Alt + L Make lowercase from cursor to end of word.  
  • Alt + U Make uppercase from cursor to end of word.  
  • Alt + C Capitalize start to end of word starting at the cursor (whole word if cursor is at the beginning of the word).  
  • Alt + D Delete to the end of the word starting at the cursor (whole word if the cursor is at the beginning of the word).  
  • Alt + . Prints the last word written in the previous command.  
  • Ctrl + T Swap the last two characters before the cursor.
  • 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).
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 the current matched command to the 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 the last executed command, i.e. walk back through the command history (similar to up arrow).  
  • Ctrl + N shows the next executed command, i.e. walk forward through the command history (similar to down arrow).
  • 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 returns 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 + 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 returns 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 + 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 returns 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.
Terminal 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 returns 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.
Special characters
  • Ctrl + H Same as Backspace.  
  • Ctrl + J Same as Return (historically Line Feed).  
  • Ctrl + M Same as Return (historically Carriage Return).  
  • Ctrl + I Same as Tab.  
  • Ctrl + G Bell Character.  
  • Ctrl + @ Null Character.  
  • Esc Deadkey equivalent to the Alt modifier.  
Close Terminal
## Close Terminal  
- Ctrl + Shift + W To close terminal tab.  
- Ctrl + Shift + Q To close entire terminal.
  • Ctrl + Shift + W To close terminal tab.  
  • Ctrl + Shift + Q To close entire terminal.
Conclusion
Check me out @xtremepentestif you liked this thread!!
I’m gonna be tweeting more about Linux, networking, security, etc.
That’s it!
Thank you for making it this far. Hopefully, you will find this newsletter useful.
Additions are welcomed.
Check me out xtremepentest if you liked this letter!!
I’m gonna be writing more about Linux, networking, security, etc.
Did you enjoy this issue? Yes No
Traw
Traw

Everything about Linux🐧, Networking🌐, Pentesting🐱‍💻 beginner tips💡 & resources🎒

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.