Cheatsheet

Command Line Shortcuts

Cheatsheet for command line shortcuts

Table of Contents
  1. Shortcuts for moving around
  2. Cutting and pasting
  3. Text manipulation
  4. Other useful shortcuts
  5. Get the cheatsheet

This was originally posted on my theflyingdev page.

Shortcuts for moving around

Let's be honest how many times do we write a command, just to notice that around the beginning of the line there is a mistake and we delete everything and type the command again? These shortcuts will help you move the cursor easier without the need to delete the whole thing.

  • CTRL + A - Moves the cursor to the beginning of the line
  • CTRL + E - Moves the cursor to the end of the line
  • CTRL + arrow keys - Moves the cursor from word to word
  • ALT + B - Moves the cursor back from word to word
  • ALT + F - Moves cursors forward from word to word

Cutting and pasting

  • CTRL + W - Cut the word left of the cursor
  • CTRL + K - Cut the entire text at the right of the cursor
  • CTRL + U - Cut the entire line
  • CTRL + Y - Paste the previous cut text
  • ALT + W - Cut the entire text at the left of the cursor

Text manipulation

  • CTRL + T - Swap two letters between the cursor
    • Example: this if the cursor is between the h and i it turns into tihs
  • ESC + T - Swap two words between the cursor
    • Example: this text will become text this
  • ESC + U - Uppercases text right of the cursor - moves cursor to the end of word
  • CTRL + Q - Deletes text from line - clears line only

Other useful shortcuts

  • CTRL + L - Clears the terminal -> No need to write clear all the time!
  • CTRL + R - Reverse search your history for a term
    • Use CTRL + R again to cycle through results
  • !! Repeat the last command used in the terminal
  • Use sudo !! to repeat the last command with sudo

Get the cheatsheet

terminal shortcuts light

terminal shortcuts dark

Webmentions

0 Like 0 Comment

You might also like these

Cheatsheet for LunarVim

Read More
Cheatsheet

LunarVim

LunarVim

Cheatsheet for Bash scripting

Read More
Cheatsheet

Bash Scripting

Bash Scripting

Cheatsheet for Docker

Read More
Cheatsheet

Docker

Docker

Cheatsheet for the editor VIM

Read More
Cheatsheet

Vim

Vim