Explore our extensive Linux Commands Cheat Sheet, covering essential commands for beginners and advanced users. From file management to system monitoring, learn the commands you need to master Linux. Perfect for quick reference and boosting your Linux skills.
Command | Description |
date | Displays the current time and date |
cal | Displays the current month’s calendar |
df | Shows the current amount of free space on disk drives |
free | Displays the amount of free memory |
exit | Ends a terminal session or logs out from the current user session |
pwd | Prints the current working directory |
ls | Lists directory contents |
cd | Changes the directory |
cd ~ | Changes the directory to the previous working directory |
cd .. | Moves one directory back |
cd User_Name | Moves to the specified user’s home directory |
ls /path | Lists directory contents for a specific path |
ls -l | Lists directory contents in long format |
ls -a | Lists all files, including hidden files |
ls -A | Lists all files except . and .. |
ls -d | Lists the contents of directories, not the directories themselves |
ls -F | Appends indicator characters to each listed name to denote file types |
ls -h | Displays file sizes in a human-readable format |
ls -r | Lists directory contents in reverse order |
ls -S | Sorts results by file size |
ls -t | Sorts results by last modified time |
file filename | Determines and prints the file type of a specified file |
cp | Copies files and directories |
mv | Moves or renames files and directories |
mkdir | Creates directories |
rm | Removes files |
rmdir | Removes empty directories |
ln | Creates hard and symbolic links |
mkdir Folder1 Folder2 | Creates multiple directories |
cp -a | Copies files and directories along with their attributes |
cp -i | Prompts for confirmation before overwriting files |
cp -r | Recursively copies entire directories |
cp -u | Copies files only if the source is newer |
mv -i | Prompts for confirmation before overwriting files |
mv -u | Moves or renames files only if the source is newer |
touch | Creates a new empty file or updates the timestamp of a file |
cat | Concatenates and displays the content of files |
more | Views the content of a file one screen at a time |
less | Views the content of a file, allowing backward movement in the file |
head | Displays the first 10 lines of a file by default |
tail | Displays the last 10 lines of a file by default |
tail -f | Follows the content of a file as it grows, useful for monitoring log files |
echo | Displays a line of text or variables |
grep | Searches text using patterns |
find | Searches for files and directories within a directory hierarchy |
locate | Finds files by name using a pre-built database |
du | Estimates file space usage |
chmod | Changes file mode (permissions) |
chown | Changes file owner and group |
stat | Displays detailed information about a file or file system |
df -h | Displays disk space usage in human-readable format |
ps | Displays currently running processes |
top | Displays tasks running on the system in real-time |
kill | Sends a signal to terminate a process |
killall | Terminates all processes with a specified name |
pkill | Sends a signal to a process based on name and other attributes |
service | Manages services (start, stop, restart, status) |
systemctl | Controls the systemd system and service manager |
journalctl | Views logs collected by systemd |
whoami | Displays the current logged-in user’s username |
hostname | Displays or sets the system’s hostname |
uname | Displays system information |
uptime | Shows how long the system has been running |
reboot | Reboots the system |
shutdown | Shuts down or reboots the system |
ping | Sends ICMP ECHO_REQUEST to network hosts |
traceroute | Displays the route packets take to a network host |
curl | Transfers data from or to a server, supports multiple protocols |
wget | Downloads files from the web |
scp | Securely copies files between hosts over a network |
rsync | Synchronizes files and directories between two locations |
tar | Archives files into a single file or extracts them |
gzip | Compresses files using the gzip algorithm |
gunzip | Decompresses files compressed with gzip |
zip | Compresses files into a zip archive |
unzip | Extracts files from a zip archive |
bzip2 | Compresses files using the bzip2 algorithm |
bunzip2 | Decompresses files compressed with bzip2 |
alias | Creates a shortcut for a command |
unalias | Removes an alias |
history | Displays the command history |
env | Displays the environment variables |
export | Sets environment variables |
unset | Unsets or removes a variable |
sudo | Executes a command as another user, typically the superuser |
su | Switches to another user account |
passwd | Changes the user’s password |
df -T | Displays the file system type along with disk space usage |
df -i | Displays inode information along with disk space usage |
mount | Mounts a file system |
umount | Unmounts a file system |
lsblk | Lists information about block devices |
blkid | Displays block device attributes, such as UUID and file system type |
fdisk | Manipulates disk partition tables |
parted | A partition editor to create, delete, resize, and manage disk partitions |
mkfs | Creates a file system on a partition |
fsck | Checks and repairs a Linux file system |
dd | Converts and copies files, useful for creating bootable USB drives |
who | Displays who is currently logged in |
w | Displays who is logged in and what they are doing |
last | Shows the last login sessions of users |
clear | Clears the terminal screen |
df -h | Displays disk usage in human-readable format |
df -T | Displays the file system type |
touch | Creates a new, empty file |
which | Locates the path of an executable file |
whereis | Locates the binary, source, and manual page files for a command |
time | Measures the duration of command execution |
bg | Resumes a suspended job in the background |
fg | Brings a background job to the foreground |
jobs | Lists active jobs |
nohup | Runs a command immune to hangups (keep running even after logging out) |
sleep | Delays for a specified amount of time |
wait | Waits for a process to complete |
xargs | Constructs argument list(s) and executes a command |
diff | Compares the contents of two files line by line |
cmp | Compares two files byte by byte |
comm | Compares two sorted files line by line |
sort | Sorts lines of text files |
uniq | Reports or omits repeated lines |
cut | Removes sections from each line of files |
paste | Merges lines of files |
tr | Translates or deletes characters from a stream |
sed | Stream editor for filtering and transforming text |
awk | Pattern scanning and processing language |