Catalog / Command Line Tools Cheatsheet
Command Line Tools Cheatsheet
A comprehensive guide to essential command-line tools, covering navigation, file manipulation, system information, and more. This cheat sheet provides quick references and examples to boost your command-line efficiency.
Navigation & File Management
Basic Navigation
|
Print working directory (shows the current directory).
|
|
Change directory.
|
|
List directory contents.
|
File Manipulation
|
Create an empty file.
|
|
Copy a file or directory.
|
|
Move or rename a file or directory.
|
|
Remove a file.
Caution: This action is irreversible! |
|
Remove a directory recursively (including all files and subdirectories).
Caution: Use with extreme care! |
|
Create a new directory.
|
|
Remove an empty directory.
|
File Content Display
|
Display the entire contents of a file.
|
|
View file contents one page at a time. Navigate with arrow keys or
|
|
Display the first few lines of a file (default 10 lines).
|
|
Display the last few lines of a file (default 10 lines).
|
System Information & Process Management
System Information
|
Display system information (kernel name, network node hostname, kernel release, kernel version, machine).
|
|
Display disk space usage in a human-readable format.
|
|
Display memory usage in megabytes.
|
|
Show how long the system has been running, along with the current time and load averages.
|
|
Display information about the CPU architecture.
|
Process Management
|
Display all running processes with detailed information.
|
|
Display a dynamic real-time view of running processes.
|
|
Terminate a process with the specified PID (Process ID).
|
|
Forcefully terminate a process (use as a last resort).
Caution: May cause data loss. |
|
Place a stopped process in the background.
|
|
Bring a background process to the foreground.
|
User Management
|
Display the current user’s username.
|
|
Display user and group ID information.
|
|
Show who is logged on and what they are doing.
|
|
List last logged in users.
|
Text Processing & Search
Text Processing
|
Search for a pattern in a file.
|
|
Stream editor for replacing text in a file. This example replaces all occurrences of ‘old’ with ‘new’.
|
|
A powerful text processing tool. This example prints the first column of each line.
|
|
Sort lines in a file.
|
|
Remove duplicate lines from a file (often used with
|
|
Count words, lines, and bytes in a file.
|
|
Cut sections from each line of a file. This example cuts the first field from a comma-separated file.
|
Find Command
|
Find files with a specific name pattern in the current directory and its subdirectories.
|
|
Find files larger than 1MB in the current directory and its subdirectories.
|
|
Find files modified in the last 7 days.
|
|
Find empty files and directories.
|
|
Find files with specific permissions.
|
Networking & Package Management
Networking Tools
|
Test network connectivity to a host.
|
|
Trace the route packets take to a host.
|
|
Display network connections, listening ports, and associated processes.
|
|
Display network interface configuration.
|
|
Secure Shell - connect to a remote host.
|
|
Secure Copy - copy files between hosts.
|
Package Management (Debian/Ubuntu)
|
Update the package lists.
|
|
Upgrade installed packages.
|
|
Install a new package.
|
|
Remove a package.
|
|
Remove a package and its configuration files.
|
|
Show information about a package.
|
Package Management (RedHat/CentOS/Fedora)
|
Update all packages.
|
|
Install a package.
|
|
Remove a package.
|
|
Show information about a package.
|
|
Update all packages (Fedora).
|
|
Install a package (Fedora).
|