100+ Linux Commands with Downloadable Cheat Sheet
You can achieve virtually anything on a Linux operating system using a command. Whether you want to send a file to the printer, set up your system firewall, or edit a file without even opening it; you can do it all directly from the terminal.
There’re thousands of commands available on any Linux system and more handed to you whenever you install new software or packages. It’s a common misconception amongst beginners that you have to cram all of these commands in order to be considered an expert, but in reality, you only need to know a small subset of commands to become a proficient Linux administrator.
In this article, we’ll be sharing 100+ such commands across different categories along with a downloadable cheat sheet.
Basic Commands
Command
Description
ls
ls -l
ls -t
ls
by last modified datepwd
cd directory
cd ..
cd /
clear
history
touch filename
vi filename
cat filename
hostnamectl
ifconfig
date
top
free -m
head filename
tail filename
mv file /new/file/path
mv filename new_filename
cp filename new_filename
man command_name
rm filename
rm –rf directory_name
sudo
mkdir directory_name
kill pid
reboot
shutdown –h now
Networking Commands
Command
Description
dig domain_name
dig -x host
host domain_name
whois domain_name
ping ip
ssh username@ip
wget file
wget -c file
traceroute domain_name
telnet domain_name port
netstat –pnltu
route
arp
cat /etc/resolv.conf
tcpdump -i eth1 'port 80'
nmap ip
Search Commands
Command
Description
locate keyword
find
but many not show all resultsfind keyword
locate
but is always up-to-datefind /home -name *.ext
/home
directory and all its sub-directoriesfind / -type f ! -perm xxx
find / -perm /u=r
grep keyword filename
grep keyword *
grep -i keyword *
grep -r keyword *
grep -x 'what to match' *
grep -c keyword *
Permissions Commands
Command
Description
chmod xxx filename
chmod –R xxx directory
chmod –x filename
chown username filename
chown username:groupname filename
chown username:groupname filename1 filename2 filename3
chown --from=bob alice filename
--from=
)chown -h usergroup symbolic_link
Storage Commands
Command
Description
df –h
mount
unmount
du -h /home/directory_name
du -sh /home/directory_name
du -ah --exclude='*.xxx' /home/directory_name
du -ha --time /home/directory_name
fdisk -l
sudo du -x / | sort -nr | head -20
User Management Commands
Command
Description
adduser username
userdel -r 'username'
passwd -l 'username'
whoami
usermod -c 'This user will be deleted tomorrow' username
cat /etc/passwd
usermod -d /home/test username
sudo deluser username group_name
usermod -a -G group_name username
groupadd group_name
groupdel group_name
id
Archive Commands
Command
Description
tar -cvf archive.tar filename.txt
tar -tvf archive.tar
tar -xvf archive.tar filename.txt
zip archive.zip file1.txt file2.html file3.jpg
zip -u archive.zip filename.txt
zip -d archive.zip filename.txt
unzip archive.zip
unzip archive.zip -d /directory_name
tar xf archive
gzip filename
gzip -c filename > archive.gz
Advanced Commands
Command
Description
ps –ef | grep process_name
netstat –pnltu | grep port
history | grep keyword
ip r
ssh-keygen
scp filename user@ip:/home/location
find / -type f -perm 777 -print -exec chmod xxx {} \;
sed -i 's/CONTENT_TO_REPLACE/CONTENT_TO_REPLACE_IT_WITH/g' filename
tcpdump -nnvvS src SRC_IP and dst port xxxx
traceroute domain_name -q 5
Downloadable Cheat Sheet
Download the 2560×1440 wallpaper cheat sheet for easy reference.