← all cheatsheets
Linux Commands

Linux Commands

50 DevOps Essentials

Navigation & BasicsFile OperationsFile Viewing & EditingText ProcessingFinding ThingsCompression & ArchivesSystem InfoProcesses & ServicesNetworkingPermissions & UsersKeyboard Shortcuts

Navigation & Basics

CommandDescription
lsList directory contents
llLong listing (with permissions)
cdChange directory
pwdPrint working directory

File Operations

CommandDescription
mkdirMake directory
rmdirRemove empty directory
rmRemove files or directories
cpCopy files or directories
mvMove or rename files/directories
touchCreate an empty file / update timestamp

File Viewing & Editing

CommandDescription
catDisplay file contents
lessView file contents interactively
headShow first 10 lines of a file
tailShow last 10 lines of a file
nanoText editor (nano)
vi / vimText editor (vi/vim)

Text Processing

CommandDescription
grepSearch text in files
echoPrint text to terminal
>Redirect output to a file
>>Append output to a file
|Pipe one command output to another

Finding Things

CommandDescription
findFind files in directory hierarchy
locateFind files by name (quick search)
whichLocate command or binary
whereisLocate binary, source, man page

Compression & Archives

CommandDescription
tarCreate / extract tar archives
gzip / gunzipCompress / decompress files
zip / unzipCompress / decompress zip files

System Info

CommandDescription
dfDisk space usage
duDisk usage of files/directories
freeMemory usage
topReal-time process monitoring
htopInteractive process viewer

Processes & Services

CommandDescription
psProcess status (e.g. ps -ef)
killTerminate a process (e.g. kill -9 <PID>)
systemctlManage systemd services
serviceManage services (SysV)

Networking

CommandDescription
netstatNetwork connections (netstat -tulnp)
ssSocket statistics — modern netstat
ipShow/modify network interfaces (ip a)
pingTest connectivity
curlTransfer data from URLs
wgetDownload files from the web
sshSecure shell to remote host
scpSecure copy files to remote host

Permissions & Users

CommandDescription
chmodChange file permissions
chownChange file owner/group
useraddAdd a new user
usermodModify user account

Keyboard Shortcuts

ShortcutAction
TabAuto-complete
Ctrl + CCancel
Ctrl + ZSuspend
Ctrl + DLogout / exit