Useful CLI Shortcuts
General Navigation
Ctrl + A
: Move to the beginning of the line. Quickly jumps to the start of the current command line.Ctrl + E
: Move to the end of the line. Takes you to the end of the current command line for easy editing.
Editing Commands
Ctrl + K
: Cut the text from the current cursor position to the end of the line. Useful for quickly removing the latter part of a command.Ctrl + U
: Cut the text from the current cursor position to the beginning of the line. Clears the command line up to the current cursor position.
Handling Words
Alt + B
: Move back one word. Navigates backward through the command line, one word at a time.Alt + F
: Move forward one word. Moves the cursor forward by one word, making it easier to navigate longer commands.Ctrl + W
: Cut the word before the cursor. Removes the word immediately before the cursor, a quick way to delete a single word.Alt + D
: Cut the word after the cursor. Deletes the word immediately after the cursor, useful for quick edits.
Command History
Ctrl + R
: Search the command history. Allows you to search through previously used commands.Ctrl + G
: Exit from the history searching mode. Useful for returning to the normal command line mode.
Process Control
Ctrl + C
: Kill the current process. Stops the currently running command immediately.Ctrl + Z
: Suspend the current process. Pauses the running command, allowing you to resume it later.
Miscellaneous
Ctrl + L
: Clear the screen. Cleans the terminal window for a fresh start.Tab
: Auto-complete files, folders, and command names. Saves time by completing commands and paths automatically.
Note: These shortcuts are commonly used in Unix-like systems and may vary slightly based on the terminal or shell you are using.