← Cheatsheets
Linux
Bash / Shell
Everyday bash commands for navigation, file operations, process management and scripting.
Navigation & Files
ls -lahcd -pwdmkdir -p path/to/dircp -r src/ dst/mv src dstrm -rf <dir>ln -s target linkfind . -name "*.log"find . -type f -mtime -1Permissions
chmod 755 <file>chmod +x <file>chown user:group <file>chown -R user:group <dir>umask 022Text & Files
less <file>tail -f <file>head -n 20 <file>wc -l <file>sort file.txtsort -rn file.txtuniqcut -d',' -f1 file.csvdiff file1 file2Process Management
ps auxkill <pid>kill -9 <pid>pkill <name>jobsCtrl+zbg %1fg %1nohup <cmd> &Variables & Scripting
VAR=valueexport VAR=value$?$0 / $1 / $#$@[ -f file ][ -d dir ][ -z "$VAR" ]Redirection & Pipes
cmd > filecmd >> filecmd 2>&1cmd &> filecmd1 | cmd2cmd < filetee filecmd 2>/dev/nullNetworking
ss -tlnpnc -zv host 443dig <domain>ping -c 4 <host>traceroute <host>ip addr show