Top 100 Linux Commands Engineers Use Daily

This page focuses on commands that are practical in real backend, DevOps, CI/CD, support and scripting work. The descriptions are short for fast lookup.

Command Reference

#CommandBrief DescriptionExample
1pwdPrint current directorypwd
2lsList filesls -lah
3cdChange directorycd /opt/apps
4mkdirCreate directorymkdir -p /opt/app/config
5touchCreate empty filetouch app.log
6cpCopy filescp app.jar /opt/apps/
7mvMove or renamemv old.log archive.log
8rmRemove filesrm -rf temp/
9rmdirRemove empty directoryrmdir olddir
10treeShow directory treetree -L 2
11findFind filesfind /opt -name '*.jar'
12locateFast indexed file searchlocate application.yml
13whichLocate executablewhich java
14whereisLocate binary/source/man pageswhereis docker
15statFile metadatastat app.log
16duDirectory sizedu -sh /var/log
17dfDisk usagedf -h
18fileIdentify file typefile app.jar
19basenameStrip pathbasename /opt/apps/app.jar
20dirnameGet directory partdirname /opt/apps/app.jar
21catPrint file contentscat app.log
22lessView large filesless app.log
23headShow first lineshead -20 app.log
24tailShow last linestail -f app.log
25wcCount lines/words/byteswc -l app.log
26sortSort linessort users.txt
27uniqRemove duplicates or countsort users.txt | uniq -c
28cutExtract columnscut -d, -f1 users.csv
29pasteMerge lines/columnspaste a.txt b.txt
30trTranslate/delete characterstr '[:lower:]' '[:upper:]'
31grepSearch textgrep -n ERROR app.log
32egrepExtended grepegrep 'ERROR|WARN' app.log
33fgrepFixed string grepfgrep 'NullPointerException' app.log
34awkPattern scanning and reportingawk '{print $1,$4}' access.log
35sedStream editingsed 's/localhost/127.0.0.1/g' config.yml
36xargsBuild commands from inputfind . -name '*.log' | xargs grep ERROR
37teeWrite output to file and screenjava -jar app.jar | tee run.log
38splitSplit large filessplit -l 50000 big.log chunk_
39diffCompare filesdiff a.txt b.txt
40cmpByte-level comparecmp file1 file2
41commCompare sorted filescomm list1 list2
42tarArchive filestar -czvf backup.tar.gz /opt/apps
43gzipCompress filegzip app.log
44gunzipUncompress gz filegunzip app.log.gz
45zipCreate zip archivezip -r app.zip app/
46unzipExtract zip archiveunzip app.zip
47psList processesps aux | grep java
48pgrepFind process by namepgrep -af spring
49pkillKill by namepkill -f spring
50killTerminate processkill -15 1234
51killallKill all matching processeskillall java
52topInteractive process monitortop
53htopImproved process monitorhtop
54niceStart with prioritynice -n 10 java -jar app.jar
55reniceChange process priorityrenice 5 -p 1234
56freeMemory usagefree -h
57uptimeLoad and uptimeuptime
58vmstatSystem performance snapshotvmstat 1 5
59iostatCPU and disk IOiostat -xz 1 3
60mpstatCPU per corempstat -P ALL 1 3
61lsofOpen files and socketslsof -i :8080
62ssSocket statisticsss -tulnp
63netstatNetwork stats (legacy but still common)netstat -tulnp
64ipIP and route managementip addr
65pingConnectivity testping -c 4 google.com
66tracerouteNetwork pathtraceroute github.com
67nslookupDNS querynslookup example.com
68digAdvanced DNS querydig example.com
69curlHTTP/API callscurl http://localhost:8080/actuator/health
70wgetDownload filewget https://repo1.maven.org/...
71sshRemote loginssh user@server
72scpSecure copyscp app.jar user@server:/opt/apps
73rsyncFast syncrsync -avz logs/ user@server:/backup/logs
74sftpInteractive file transfersftp user@server
75chmodChange permissionschmod +x deploy.sh
76chownChange ownerchown app:app logs/
77chgrpChange groupchgrp devops deploy.sh
78umaskDefault permission maskumask 022
79sudoRun as elevated usersudo systemctl restart app
80suSwitch usersu - appuser
81envShow environmentenv | sort
82exportSet environment variableexport JAVA_HOME=/opt/jdk
83aliasCreate shortcutalias ll='ls -lah'
84historyCommand historyhistory | tail -20
85clearClear terminalclear
86echoPrint text/variablesecho $PATH
87printfFormatted outputprintf '%s\n' hello
88dateShow date/timedate '+%F %T'
89calCalendarcal
90sleepPause in scriptssleep 5
91watchRepeat commandwatch -n 2 'df -h'
92crontabSchedule recurring jobscrontab -e
93systemctlManage systemd servicessystemctl status app
94journalctlRead service logsjournalctl -u app -f
95hostnameShow host namehostname
96unameKernel/system infouname -a
97whoamiCurrent userwhoami
98idUser and groupsid
99mountMounted filesystemsmount | grep /data
100umountUnmount filesystemumount /mnt/backup
101dockerContainer CLIdocker ps
102gitVersion controlgit status