Catalog / Linux Command Line Cheat Sheet
Linux Command Line Cheat Sheet
A quick reference guide to essential Linux command line shortcuts and commands for efficient navigation and system management.
Basic Navigation
Essential Navigation Shortcuts
|
Change directory to home directory. |
|
Change directory to |
|
Move one directory up. |
|
Go to the previous directory. |
|
Print working directory (current directory path). |
|
List files and directories in the current directory. |
|
List files with detailed information (permissions, size, date). |
|
List all files, including hidden files (files starting with |
|
Sort files by modification time (newest first). |
File and Directory Management
|
Create a new directory named |
|
Remove an empty directory. |
|
Recursively remove a directory and its contents (use with caution!). |
|
Create an empty file or update the timestamp of an existing file. |
|
Copy a file or directory from |
|
Move or rename a file or directory. |
|
Remove a file. |
|
Create a symbolic link named |
|
Finds file with the filename from the current directory. |
Shell Shortcuts and Commands
Command Line Editing
Ctrl + A |
Move cursor to the beginning of the line. |
Ctrl + E |
Move cursor to the end of the line. |
Ctrl + K |
Cut the line from the cursor position to the end. |
Ctrl + U |
Cut the line from the cursor position to the beginning. |
Ctrl + Y |
Paste the last cut text (yank). |
Ctrl + R |
Search command history. |
Ctrl + W |
Cut the word before the cursor. |
Alt + F |
Move cursor forward one word. |
Alt + B |
Move cursor backward one word. |
Process Management
Ctrl + C |
Terminate the current process. |
Ctrl + Z |
Suspend the current process (send it to the background). |
|
Bring the last suspended process to the foreground. |
|
Run the last suspended process in the background. |
|
List all background jobs. |
|
Kill a specific background job. |
|
Display currently running processes. |
|
Display dynamic real-time view of running processes. |
|
Kill a process by its process ID (PID). |
System Information and Control
System Information
|
Display kernel information. |
|
Show how long the system has been running. |
|
Display disk space usage. |
|
Display memory usage. |
|
Display the current username. |
|
Display the current date and time. |
|
Display the calendar. |
|
Display command history. |
|
Display the value of the variable. |
System Control
|
Shut down the system immediately (requires sudo). |
|
Reboot the system (requires sudo). |
|
Close the current terminal. |
Ctrl + D |
Close the current terminal (alternative to |
|
Change user password. |
|
Clear the terminal screen. |
|
Logs out the current user. |
File Operations and Permissions
File Content Viewing
|
Display the entire content of a file. |
|
View file content page by page. Use arrow keys to navigate, |
|
Display the first 10 lines of a file. |
|
Display the last 10 lines of a file. |
|
Display the last 10 lines and follow the file for new content (useful for log files). |
|
Display file content with line numbers. |
File Permissions
|
Change file permissions. |
|
Change file ownership. |
|
Show the current umask value. This determines default file permissions for newly created files and directories. |
|
Grants read, write, and execute permissions to everyone (use with extreme caution). |
|
Example to change file owner and group of file. |
|
Displays status and details about the file. |