Essential Linux Commands Every Beginner Should Know

Whether you’re an aspiring system administrator, developer, or just a Linux enthusiast, knowing the right commands can dramatically boost your productivity and confidence. In this post, we’ll cover essential Linux commands that are not only useful for daily tasks but are also frequently asked in interviews.

Each command comes with a description, example usage, and pro tips to help you master Linux from the command line.

System Information & Monitoring

CommandDescriptionExample
uname -aShow system/kernel infouname -a
hostnameShow/modify hostnamehostname
uptimeHow long the system has been runninguptime
topReal-time system monitoringtop
htopInteractive process viewer (better top)htop (needs install)
freeShow memory usagefree -h
dfShow disk usagedf -h
du -sh /folderFolder sizedu -sh /var/log
vmstatSystem performance statsvmstat 1
iostatCPU and I/O usageiostat (from sysstat package)

File and Directory Management

CommandDescriptionExample
lsList files and directoriesls -l /home
cdChange directorycd /etc
pwdShow current directorypwd
mkdirCreate directorymkdir projects
rmdirRemove empty directoryrmdir temp
rmRemove files or directoriesrm -rf folder
cpCopy files/directoriescp file.txt backup/
mvMove/rename filesmv file.txt archive.txt
touchCreate an empty filetouch index.html
findSearch for filesfind / -name “*.log”
locateFast search (uses a DB)locate passwd
statShow file detailsstat file.txt

File Viewing & Editing

CommandDescriptionExample
catShow file contentscat file.txt
more / lessView large files page by pageless /var/log/syslog
headShow first lines of filehead -n 10 file.txt
tailShow last linestail -f /var/log/messages
nanoTerminal text editornano config.txt
vimAdvanced text editorvim script.sh

User and Permission Management

CommandDescriptionExample
whoamiShow current userwhoami
idShow UID, GID, groupsid
adduserAdd a useradduser john
passwdChange passwordpasswd john
usermodModify userusermod -aG sudo john
deluserDelete a userdeluser john
chmodChange file permissionschmod 755 script.sh
chownChange file ownerchown root:root file

Package Management

For Debian/Ubuntu:

CommandDescriptionExample
apt updateUpdate package indexsudo apt update
apt upgradeUpgrade all packagessudo apt upgrade
apt installInstall a packagesudo apt install nginx
apt removeRemove a packagesudo apt remove nginx
dpkg -iInstall .deb filesudo dpkg -i package.deb

For Red Hat/CentOS:

CommandDescriptionExample
yum installInstall a packagesudo yum install httpd
dnfModern yum alternativednf install vim
rpm -ivhInstall rpm packagerpm -ivh package.rpm

Networking Commands

CommandDescriptionExample
ip aShow IP addressip a
ifconfig(deprecated) Show interfacesifconfig
pingCheck connectivityping google.com
tracerouteShow route to hosttraceroute google.com
netstat -tulnList open portsnetstat -tuln
ss -tulnModern alternative to netstatss -tuln
curlFetch data from URLcurl https://example.com
wgetDownload fileswget https://example.com/file.zip
scpSecure file copyscp file user@host:/path/
sshRemote loginssh user@192.168.1.1

Process and Service Management

CommandDescriptionExample
ps auxList all processesps aux
killKill a process by PIDkill 1234
killallKill by namekillall firefox
systemctlManage services (systemd)systemctl restart nginx
serviceManage older init.d servicesservice apache2 status
crontab -eEdit scheduled taskscrontab -e

Disk and Partitioning

CommandDescriptionExample
lsblkList block deviceslsblk
fdisk -lPartition tablesudo fdisk -l
mountMount a drivemount /dev/sdb1 /mnt
umountUnmount a driveumount /mnt
mkfs.ext4Format partitionmkfs.ext4 /dev/sdb1
blkidShow device UUIDsblkid

Final Thoughts

Mastering these Linux commands will:

  • Help you navigate and manage any Linux environment
  • Make you confident in interviews for SysAdmin, DevOps, and Support roles
  • Equip you with the skills to automate and troubleshoot tasks

Scroll to Top