Lesson 1: File and Directory Management

CommandDescriptionExampleOutput
pwdShow current directorypwd/home/user
lsList directory contentsls -ldrwxr-xr-x 2 user user 4096 ...
cdChange directorycd Documents
mkdirCreate directorymkdir project
touchCreate empty filetouch file.txt
rmRemove filerm file.txt
rmdirRemove empty directoryrmdir project
cpCopy files/directoriescp file.txt backup.txt
mvRename/move filesmv backup.txt old.txt
findSearch for filesfind . -name "*.log"./app.log ./archive/error.log

Lesson 2: File Viewing and Editing

CommandDescriptionExampleOutput
catConcatenate/display filescat file.txtContents of file.txt...
lessPaged file viewingless largefile.txtPaged content...
moreView file one screen at a timemore log.txtFirst screen of content...
headShow first lineshead -3 file.txtFirst 3 lines of file.txt...
tailShow last linestail -n 5 file.txtLast 5 lines of file.txt...
nanoText editornano newfile.txtEdit interface opens
viClassic text editorvi config.txtvi editor interface
echoOutput textecho "Hello" > greeting.txt
teeRedirect output to fileecho "Test" | tee log.txtTest (and writes to log.txt)
odOctal dumpod -c file.txtCharacter display of file.txt...

Lesson 3: File Manipulation

CommandDescriptionExampleOutput
truncateShrink/grow filestruncate -s 0 file.txt
splitSplit files into chunkssplit -l 1000 log.txtCreates xaa, xab...
joinJoin lines of filesjoin file1.txt file2.txtMerged lines...
ddConvert/copy filesdd if=file of=copy bs=1MCopies file to copy
lnCreate linksln -s file.txt link.txtCreates symbolic link
pasteMerge lines side-by-sidepaste file1 file2Tab-separated columns...
fmtReformat paragraphsfmt -w 40 file.txtFormatted text...
commCompare sorted filescomm file1.txt file2.txtShows common/unique lines
expand/unexpandConvert spaces/tabsexpand file.txtConverts tabs to spaces
shredSecurely delete filesshred -u secret.txtOverwrites then deletes

Lesson 4: Search and Text Processing

CommandDescriptionExampleOutput
grepText searchgrep "error" log.txtLines containing "error"...
findSearch filesfind /etc -name "*.conf"/etc/apache2/apache2.conf...
sedStream editorsed 's/old/new/g' file.txtReplaces "old" with "new"
awkText processingawk '{print $1}' file.txtFirst column of each line
cutExtract columnscut -d, -f2 data.csvSecond column of CSV
sortSort linessort file.txtAlphabetically sorted lines
uniqRemove duplicatesuniq -u log.txtUnique lines only
fileIdentify file typefile image.jpgJPEG image data...
stringsExtract printable stringsstrings binaryHuman-readable text in binary
egrepExtended regex grepegrep "[0-9]+" file.txtLines with numbers...

Lesson 5: Permissions and Ownership

CommandDescriptionExampleOutput
chmodChange permissionschmod 755 script.sh
chownChange ownerchown user:group file.txt
chgrpChange groupchgrp developers project
ls -lList permissionsls -l-rw-r--r-- 1 user...
getfaclGet access control listsgetfacl file.txtACL permissions...
setfaclSet ACL permissionssetfacl -m u:guest:r file.txt
umaskShow/create permissionsumask0022
statShow file detailsstat file.txtPermissions: 644...
idShow user/group IDsid useruid=1000(user) gid=1000...
groupsList user groupsgroups useruser : user adm cdrom...

Lesson 6: User Management

CommandDescriptionExampleOutput
useraddCreate useruseradd newuser
userdelDelete useruserdel olduser
passwdChange passwordpasswd userPassword updated
usermodModify userusermod -aG sudo user
groupsList user groupsgroups useruser : user sudo...
idShow user IDsid useruid=1001(user) gid=1001...
suSwitch usersu rootPassword prompt
sudoRun as adminsudo apt updatePassword prompt
whoamiShow current userwhoamiuser
wShow logged in userswuser tty1 12:34...

Lesson 7: Process Management

CommandDescriptionExampleOutput
psProcess statusps auxUser PID %CPU %MEM...
topInteractive process viewtopDynamic process list
killTerminate processkill 1234
pkillKill by namepkill firefox
killallKill all instanceskillall process
bgSend job to backgroundbg %1[1]+ Process started
fgBring job to foregroundfg %1
jobsList background jobsjobs[1]+ Running...
nohupRun command immune to hangupnohup script.sh &
niceAdjust prioritynice -n 19 ./processRuns with lower priority

Lesson 8: System Monitoring

CommandDescriptionExampleOutput
topSystem monitortopCPU/memory/process list
htopEnhanced tophtopInteractive system view
freeMemory usagefree -hTotal: 7.7G used: 3.2G...
dfDisk spacedf -h/dev/sda1 234G 123G 111G...
duDirectory sizesdu -sh /var4.5G /var
iostatIO statisticsiostat -x 1 3Per-disk performance stats
vmstatSystem activity reportvmstat 2Memory/CPU/disk stats
sarSystem activity reportingsar -u 1 3CPU utilization over time
uptimeSystem loaduptime12:34:56 up 2 days...
mpstatPer-CPU statsmpstat -P ALLCPU-specific usage

Lesson 9: Networking

CommandDescriptionExampleOutput
ipNetwork configurationip a1: lo: <LOOPBACK> mtu 65536...
ifconfigShow interfacesifconfig eth0inet 192.168.1.2...
pingTest network connectionping -c 4 google.com4 packets transmitted...
netstatNetwork connectionsnetstat -tulnTCP 0.0.0.0:80...
ssSocket statisticsss -tulnTCP: 0.0.0.0:22...
nslookupDomain lookupnslookup example.comAddress 1: 93.184.216.34...
digAdvanced DNS lookupdig +short example.com93.184.216.34
curlTransfer datacurl -I https://example.comHTTP/1.1 200 OK...
wgetDownload fileswget https://example.com/file100% 12345 --00:00:01...
sshSecure shellssh user@serverPassword prompt

Lesson 10: Package Management

CommandDescriptionExampleOutput
apt-getDebian/Ubuntu package managerapt-get install nanoSelecting nano (2.0.6-1)...
aptModern apt frontendapt updateHit:1 http://archive.ubuntu.com...
rpmRPM-based package managementrpm -q kernelkernel-5.4.0-42-generic
dnfRed Hat package managerdnf install wgetDependencies resolved...
pacmanArch Linux package managerpacman -S firefoxresolving dependencies...
rpm/yumRed Hat toolsrpm -Uvh package.rpmPreparing... ################################# [100%]
dpkgDebian package installerdpkg -i package.debSelecting previously unselected package...
emergeGentoo package manageremerge -av sys-apps/procpsThese sets of USE flags would be
zypperOpenSUSE package managerzypper install curlLoading repository data...
snapUniversal package systemsnap install hello-worldhello-world 6.4 from Canonical...