Cheatsheets

Bash cheatsheet

Navigation, pipes, permissions, and process helpers for a Linux shell.

Files and navigation

Command / topicWhat it does
pwdPrint working directory
ls -lahList files with sizes and permissions
cd -Jump to the previous directory
mkdir -p a/bCreate nested directories
cp -r src destCopy recursively
rm -ri pathInteractive recursive delete

Pipes and text

Command / topicWhat it does
cmd | lessPage long output
grep -RIn needle .Search recursively with line numbers
sed -n '1,20p' filePrint lines 1–20
awk '{print $1}' filePrint first column
find . -name '*.js'Find files by name

Permissions and processes

Command / topicWhat it does
chmod u+x script.shMake a script executable for you
ps aux | grep nodeFind a process
kill -15 <pid>Ask a process to exit gracefully
df -hDisk free space
du -sh *Directory sizes

← All cheatsheets · Courses