Linux is a powerful operating system with a vast array of commands that allow users to perform tasks with efficiency and precision. Remembering all these commands can be challenging, especially for beginners. This cheat sheet serves as a quick reference guide to help you recall commands and their syntax without having to search through extensive documentation.
Why a Linux Commands Cheat Sheet is Important
A cheat sheet is used that helps you quickly reference the commands you need, saving you time and improving your workflow. Whether you’re a beginner trying to learn Linux or an experienced user needing a quick refresher, this cheat sheet is invaluable.
Linux Commands Cheat Sheet
Linux Command | Description |
---|---|
ls |
List directory contents. |
cd |
Change the current directory. |
pwd |
Print the current working directory. |
mkdir |
Create a new directory. |
rmdir |
Remove an empty directory. |
rm |
Remove files or directories. |
cp |
Copy files or directories. |
mv |
Move or rename files or directories. |
touch |
Create an empty file or update the timestamp of an existing file. |
cat |
Display file content. |
nano |
Open the Nano text editor. |
vim |
Open the Vim text editor. |
less |
View file content one screen at a time. |
more |
View file content one screen at a time. |
head |
Display the first few lines of a file. |
tail |
Display the last few lines of a file. |
grep |
Search for patterns in files. |
find |
Search for files and directories. |
chmod |
Change file permissions. |
chown |
Change file owner and group. |
ln |
Create hard and symbolic links. |
df |
Display disk space usage. |
du |
Estimate file and directory space usage. |
top |
Display real-time system information and processes. |
ps |
Display information about running processes. |
kill |
Terminate or manage processes. |
killall |
Kill all processes by name. |
xargs |
Build and execute command lines from standard input. |
tar |
Archive files. |
gzip |
Compress files. |
gunzip |
Decompress files. |
zip |
Create ZIP archives. |
unzip |
Extract ZIP archives. |
wget |
Download files from the internet. |
curl |
Transfer data from or to a server. |
scp |
Securely copy files between hosts. |
ssh |
Connect to a remote host via SSH. |
history |
Display command history. |
alias |
Create an alias for a command. |
unalias |
Remove an alias. |
echo |
Display a line of text or variables. |
uname |
Display system information. |
free |
Display memory usage. |
uptime |
Show how long the system has been running. |
who |
Display who is logged on. |
man |
Display the manual pages for commands. |
info |
Display command information. |
sudo |
Execute a command as another user, typically the superuser. |
su |
Switch to another user. |
useradd |
Add a new user. |
userdel |
Delete a user. |
usermod |
Modify a user account. |
passwd |
Change a user’s password. |
groupadd |
Add a new group. |
groupdel |
Delete a group. |
groupmod |
Modify a group. |
ifconfig |
Configure network interfaces. |
ip |
Show/manage routing, devices, policy routing, and tunnels. |
ping |
Send ICMP ECHO_REQUEST to network hosts. |
netstat |
Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. |
ss |
Investigate sockets. |
iptables |
IPv4 packet filtering and NAT administration tool. |
firewalld |
Firewall management tool. |
systemctl |
Manage systemd services. |
journalctl |
View logs collected by systemd. |
service |
Manage services. |
chkconfig |
Update and query runlevel information for system services. |
mount |
Mount a file system. |
umount |
Unmount a file system. |
mkfs |
Build a Linux file system. |
fsck |
Check and repair a Linux file system. |
crontab |
Schedule jobs to run at periodic intervals. |
at |
Schedule commands to run at a particular time. |
bg |
Resume a suspended job in the background. |
fg |
Bring a background job to the foreground. |
jobs |
List active jobs. |
nohup |
Run a command immune to hangups, with output to a non-tty. |
nice |
Run a command with modified scheduling priority. |
renice |
Alter the priority of running processes. |
shutdown |
Bring the system down. |
reboot |
Reboot the system. |
halt |
Halt the system. |
init |
Initialize and control the system. |
dmesg |
Print the kernel ring buffer. |
lsblk |
List information about block devices. |
blkid |
Locate/print block device attributes. |
rsync |
Remote file and directory synchronization. |
sftp |
Secure file transfer program. |
ftp |
File transfer protocol client. |
screen |
Terminal multiplexer. |
tmux |
Terminal multiplexer. |
Conclusion
Mastering Linux commands is crucial for anyone working with this powerful operating system. This cheat sheet provides a handy guide to the most commonly used Linux commands, helping you navigate your system with ease. Keep this cheat sheet nearby to enhance your efficiency and productivity in using Linux.
Remember, while this cheat sheet covers many commands, the true power of Linux lies in its flexibility and the extensive array of tools available. Don’t hesitate to dive deeper into each command’s documentation using the man
or info
commands, and explore the vast capabilities Linux offers. Happy learning and coding!