These commands are the foundation for DevOps, AWS, Docker, Kubernetes, Jenkins, and
system administration.
Basic Linux Commands for Beginners
Command Purpose Example
pwd Print current directory pwd
ls List files and folders ls
ls -l Detailed list ls -l
ls -a Show hidden files ls -a
clear Clear terminal screen clear
whoami Show current user whoami
date Display date and time date
cal Display calendar cal
uname -a System information uname -a
hostname Show system hostname hostname
Directory Commands
Command Purpose Example
mkdir Create directory mkdir DevOps
mkdir -p Create nested directories mkdir -p Project/Test
rmdir Remove empty directory rmdir Test
cd Change directory cd DevOps
cd .. Move one level up cd ..
cd ~ Go to home directory cd ~
cd / Go to root directory cd /
File Commands
Command Purpose Example
touch Create empty file touch [Link]
cat Display file contents cat [Link]
more View file page by page more [Link]
less Scroll through file less [Link]
head First 10 lines head [Link]
tail Last 10 lines tail [Link]
tail -f Live monitoring tail -f [Link]
Copy, Move and Delete
Command Purpose Example
cp Copy file cp [Link] [Link]
cp -r Copy directory cp -r Folder Backup
mv Move/Rename mv [Link] [Link]
rm Delete file rm [Link]
rm -r Delete directory rm -r Folder
rm -rf Force delete rm -rf Folder (use with caution)
File Editing
Command Purpose Example
echo Display text echo Hello
echo > Write to file echo "Linux" > [Link]
echo >> Append to file echo "DevOps" >> [Link]
nano Open Nano editor nano [Link]
vi Open Vim editor vi [Link]
Search Commands
Command Purpose Example
find Find files find . -name "*.txt"
locate Quickly locate file locate [Link]
grep Search text grep Linux [Link]
grep -i Ignore case grep -i linux [Link]
which Find command location which python3
File Permissions
Command Purpose Example
chmod Change permissions chmod 755 [Link]
chmod +x Make executable chmod +x [Link]
chown Change owner sudo chown ubuntu [Link]
groups Show user groups groups
User Commands
Command Purpose Example
id User information id
who Logged-in users who
Command Purpose Example
passwd Change password passwd
sudo Execute as administrator sudo apt update
Process Commands
Command Purpose Example
ps Running processes ps
ps -ef All processes ps -ef
top Real-time process monitor top
kill Stop process kill 1234
kill -9 Force stop kill -9 1234
Disk Commands
Command Purpose Example
df -h Disk usage df -h
du -sh Folder size du -sh Documents
free -h Memory usage free -h
Network Commands
Command Purpose Example
ping Test connectivity ping [Link]
ip a IP address ip a
ifconfig Network configuration (older systems) ifconfig
curl Fetch webpage/API curl [Link]
wget Download file wget [Link]
ssh Connect to remote server ssh user@ip_address
Package Management (Ubuntu/Debian)
Command Purpose Example
sudo apt update Update package list sudo apt update
sudo apt upgrade Upgrade packages sudo apt upgrade
sudo apt install Install package sudo apt install git
sudo apt remove Remove package sudo apt remove git
Compression Commands
Command Purpose Example
zip Compress files zip [Link] [Link]
unzip Extract ZIP unzip [Link]
tar -cvf Create tar archive tar -cvf [Link] Folder
tar -xvf Extract tar archive tar -xvf [Link]