Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
Bash / Linux
The shell commands you reach for every day on any Unix box.| Command | What it does | Example |
|---|---|---|
ls | List directory contents, with detail and hidden files. | ls -lah |
cd | Change the current directory. | cd /var/log |
pwd | Print the directory you are in. | pwd |
cp | Copy files or folders. | cp -r src/ backup/ |
mv | Move or rename a file. | mv draft.md final.md |
rm | Delete files or folders (careful with -rf). | rm -rf build/ |
mkdir | Create directories, including parents. | mkdir -p src/components |
cat | Print a file to the screen. | cat README.md |
less | Page through a long file (q to quit). | less app.log |
tail -f | Follow the end of a file as it grows. | tail -f /var/log/nginx/access.log |
grep | Search file contents, recursively and case-insensitively. | grep -rin "timeout" . |
find | Find files by name or type. | find . -name "*.test.js" |
sed | Find and replace text in a file in place. | sed -i 's/localhost/127.0.0.1/g' config.yml |
awk | Pull out columns from text/logs. | awk '{print $1, $7}' access.log |
chmod | Change file permissions. | chmod +x deploy.sh |
tar | Create a compressed archive of a folder. | tar -czf site.tar.gz public/ |
ps | List processes; pair with grep to find one. | ps aux | grep node |
kill | Send a signal to a process by PID. | kill -9 48213 |
df / du | Check disk space and folder sizes. | df -h && du -sh * |
xargs | Turn a list of items into command arguments. | find . -name "*.tmp" | xargs rm |
ln -s | Create a symbolic link. | ln -s /opt/app/bin/app /usr/local/bin/app |
curl | Make an HTTP request from the terminal. | curl -s https://api.github.com/zen |