Skip to main content

Command Palette

Search for a command to run...

Linux Command Cheat Sheet 🐧

Published
Linux Command Cheat Sheet 🐧
R

I'm Rudraksh Laddha — a DevOps engineer and emerging full-stack developer, passionate about building scalable, reliable systems that solve real-world problems.

With a solid foundation in cloud infrastructure automation using tools like Kubernetes, Docker, Terraform, and AWS, I thrive in environments where efficiency, resilience, and automation are key.

But my journey doesn't stop at infrastructure. I'm actively expanding into full-stack development, building dynamic applications using React, Node.js, and MongoDB. Whether it's designing cloud-native CI/CD pipelines or developing intuitive user interfaces, I enjoy creating end-to-end solutions — from server to screen.

Right now, I'm: 🧩 Building full-stack applications that merge DevOps reliability with engaging frontend experiences 🛠️ Contributing to open-source projects, learning through collaboration and real-world scenarios 🚀 Growing Virendana Ui, my own UI library focused on expressive, clean design systems 🚀 Growing Learn Virendana, where I share my personalized learning journey — from beginner to experienced 🎮 Developing side projects like 2048 Rush, blending product thinking with scalable infrastructure My long-term goal? To bridge DevOps and development — building products that are not just functional and fast, but also resilient, beautiful, and ready for scale.

Here's a Linux Command Cheat Sheet for quick reference! 🚀


🔹 File & Directory Management

CommandDescription
lsList files in a directory
ls -lList files in long format
ls -aShow hidden files
pwdPrint current working directory
cd <dir>Change directory
cd ..Move up one directory
mkdir <dir>Create a new directory
rmdir <dir>Remove an empty directory
rm <file>Delete a file
rm -r <dir>Remove a directory and its contents
cp <source> <dest>Copy a file
mv <source> <dest>Move or rename a file
touch <file>Create a new empty file
find <dir> -name <filename>Search for a file
treeDisplay directory structure

🔹 File Permissions

CommandDescription
chmod 755 <file>Change file permissions (owner: rwx, group: r-x, others: r-x)
chown user:group <file>Change file owner and group
ls -lView file permissions
umask 022Default permissions for new files

🔹 File Content & Editing

CommandDescription
cat <file>View file contents
tac <file>View file in reverse
less <file>View file one page at a time
head -n <num> <file>View first N lines of a file
tail -n <num> <file>View last N lines of a file
nano <file>Open file in Nano editor
vim <file>Open file in Vim editor
echo "text" > <file>Write text to a file (overwrite)
echo "text" >> <file>Append text to a file
grep "text" <file>Search for text in a file
wc -l <file>Count number of lines in a file
diff <file1> <file2>Compare two files
sort <file>Sort lines in a file

🔹 User Management

CommandDescription
whoamiShow current user
whoShow logged-in users
idShow user ID and group ID
adduser <user>Add a new user
passwd <user>Change user password
deluser <user>Delete a user
groupadd <group>Create a new group
usermod -aG <group> <user>Add user to a group

🔹 Process Management

CommandDescription
ps auxShow all running processes
topDisplay active processes in real-time
htopInteractive process viewer (if installed)
kill <PID>Kill a process by PID
killall <process>Kill all processes by name
pkill <process>Kill process by name
nohup <command> &Run command in background (ignore hangups)

🔹 Networking

CommandDescription
ping <host>Check connectivity to a host
curl <URL>Fetch content from a URL
wget <URL>Download a file from a URL
ifconfigShow network interfaces (deprecated)
ip addr showShow network interfaces (modern alternative)
netstat -tulnpList open ports
ss -tulnpAlternative to netstat for open ports
scp <file> user@host:/pathCopy files over SSH
rsync -avz <source> <dest>Sync files/directories
hostname -IShow local IP address

🔹 Disk & Storage

CommandDescription
df -hShow disk space usage
du -sh <dir>Show size of a directory
lsblkShow block devices (partitions)
mount /dev/sdX /mntMount a disk partition
umount /mntUnmount a partition
fdisk -lShow partition table

🔹 System Monitoring

CommandDescription
uptimeShow system uptime
free -hShow memory usage
vmstatShow system performance
iostatShow CPU & disk stats
dmesgShow boot log messages

🔹 Package Management

🔹 Debian/Ubuntu (apt)

CommandDescription
sudo apt updateUpdate package list
sudo apt upgradeUpgrade installed packages
sudo apt install <package>Install a package
sudo apt remove <package>Remove a package
dpkg -lList installed packages

🔹 Red Hat/CentOS (yum or dnf)

CommandDescription
sudo yum install <package>Install a package
sudo yum remove <package>Remove a package
sudo yum updateUpdate system

🔹 Arch (pacman)

CommandDescription
sudo pacman -S <package>Install a package
sudo pacman -R <package>Remove a package

🔹 Compression & Archiving

CommandDescription
tar -cvf archive.tar <files>Create a tar archive
tar -xvf archive.tarExtract a tar archive
tar -czvf archive.tar.gz <files>Create a gzip-compressed tar archive
tar -xzvf archive.tar.gzExtract a gzip-compressed tar archive
zip archive.zip <files>Create a zip archive
unzip archive.zipExtract a zip file

🔹 Permissions & Ownership

CommandDescription
chmod 755 <file>Change file permissions (rwx for owner, rx for others)
chmod +x <file>Make file executable
chown user:group <file>Change file owner/group
sudoExecute command as root

🔹 Shortcuts & Misc

CommandDescription
clearClear terminal screen
historyShow command history
alias ll='ls -la'Create a shortcut for a command
unalias llRemove an alias
!!Repeat the last command
CTRL + CStop a running process
CTRL + ZSuspend a process
bgResume a suspended process in background
fgResume a process in foreground

📥 Grab your free PDF here of this cheat sheet

Visit my website