Linux Terminal Cheatsheet

Essential Linux commands for file operations, permissions, processes, and system administration.

CommandDescriptionSyntaxExampleCategory
pwdPrint working directorypwdpwdNavigation
cdChange directorycd [path]cd /home/user/projectsNavigation
lsList directory contentsls [options]ls -la /homeNavigation
mkdirCreate directorymkdir [options] pathmkdir -p /path/to/dirFiles
cpCopy files/directoriescp [options] source destcp -r src/ dest/Files
mvMove/rename filesmv source destmv file.txt /home/user/Files
rmRemove files/directoriesrm [options] pathrm -rf /path/to/dirFiles
touchCreate empty filetouch filenametouch new_file.txtFiles
catView file contentscat filenamecat /etc/hostnameFiles
lessView file with paginationless filenameless /var/log/syslogFiles
headView first lines of filehead -n count filenamehead -n 20 file.txtFiles
tailView last lines of filetail -n count filenametail -f /var/log/app.logFiles
chmodChange file permissionschmod mode filechmod 755 script.shPermissions
chownChange file ownerchown user:group filechown user:group /home/user/filePermissions
sudoExecute with super user privilegessudo commandsudo apt-get install packagePermissions
psList running processesps [options]ps auxProcesses
killTerminate processkill -signal pidkill -9 1234Processes
topMonitor system processestoptopProcesses
findSearch for filesfind path -name patternfind /home -name "*.js"Search
grepSearch file contentsgrep [options] pattern filegrep -r "function" src/Search
dfShow disk space usagedf [options]df -hSystem
duShow directory sizedu [options] pathdu -sh /home/userSystem
whoamiShow current userwhoamiwhoamiSystem
unameShow system informationuname [options]uname -aSystem