Linux Command Line Cheat Sheet

This cheat sheet provides a quick reference to commonly used commands and shortcuts.
See more at the Linuxize Linux Command Cheatsheet(external link)

Common Shortcuts

Shortcut Description
~ Represents your home directory
. Represents the current directory
.. Represents the parent directory
- Switch to the previous directory
/ Represents the root directory
* Matches zero or more characters in filenames
? Matches a single character in filenames

File and Directory Management

Command Description
ls List directory contents
ls -la List all files with detailed information
cd <directory> Change to directory
pwd Print working directory
mkdir <directory> Create a new directory
rmdir <directory> Remove an empty directory
rm <file> Remove a file
cp <source> <destination> Copy files or directories
mv <source> <destination> Move or rename files or directories

Searching and Finding

Command Description
grep <pattern> <file> Search for a pattern in a file
find <directory> -name <name> Find files by name
locate <file> Locate a file quickly (uses a database)

System Information

Command Description
top Display real-time system processes
free -h Show memory usage
df -h Display disk space usage
uname -a Show system information

Networking

Command Description
ip a View the IP address
ifconfig Display network configurations
ping <host> Check connectivity to a host
curl <url> Transfer data from a URL

Miscellaneous

Command Description
man <command> Show manual for a command
clear Clear terminal screen
exit Exit the terminal