Look up any everyday Linux or bash command, see what its flags actually do and copy a working example. Search by command name or by task, such as "disk space", "find large files" or "kill process".
Last updated:
Advertisement
Advertisement
How to use the Linux Commands Cheat Sheet
Search for a command name (tar, grep, chmod) or describe the task, like "find large files" or "which process uses a port".
Filter by category with the tabs, for example Files, Text, Networking or Processes.
Read the flags under each command to understand what every option does before you run it.
Copy an example with its Copy button and replace the sample file names or paths with your own.
Download the whole cheat sheet as Markdown to keep a local copy.
Linux file permissions explained
Every file has three permission sets: for the owner (u), the group (g) and others (o). Each set is a sum of read (4), write (2) and execute (1), which is why chmod 754 means owner rwx (4+2+1), group r-x (4+1) and others r-- (4). ls -l shows the same thing as letters, such as -rwxr-xr--.
Octal
Letters
Typical use
755
rwxr-xr-x
Directories, scripts and programs everyone may run
644
rw-r--r--
Regular files: web pages, config files
700
rwx------
Private directories such as ~/.ssh
600
rw-------
Private files: SSH keys, .env files with secrets
775
rwxrwxr-x
Shared project folders where the group may write
777
rwxrwxrwx
Everyone may write. Almost never the right fix for a permission error
Important Linux directories
Path
Contains
/
The root of the single directory tree; every drive is mounted somewhere below it
/home/<user> (~)
Your personal files and hidden settings (dotfiles such as .bashrc)
/etc
System-wide configuration files
/var/log
Log files
/usr/bin, /usr/local/bin
Installed programs; /usr/local is for software you install yourself
/tmp
Temporary files, often cleared at reboot
/opt
Optional, self-contained third-party applications
/dev, /proc, /sys
Virtual filesystems for devices, processes and kernel information
/mnt, /media
Mount points for extra drives and removable media
Five habits that prevent terminal accidents
Preview before you delete. Run find … -print or ls with the same pattern before adding -delete or rm.
Quote variables like "$file" so names with spaces are not split into several arguments.
Use dry runs where they exist: rsync -n, git clean -n, apt -s.
Check device names with lsblk before dd, mkfs or partitioning; /dev/sda is usually your system disk.
Use sudo only when needed. If a command fails with "Permission denied", first ask whether you are editing the right file.
Frequently asked questions
What are the most important basic Linux commands?
Start with ls (list files), cd (change directory), pwd (show current directory), cp, mv and rm (copy, move and delete), mkdir (create a folder), cat and less (view files), grep (search text), man (read the manual) and sudo (run as administrator). These cover most daily terminal work.
Do these commands work on macOS?
Most do, because macOS is Unix-based and ships with bash or zsh. Some flags differ because macOS uses BSD versions of tools: for example sed -i needs an empty argument (sed -i '' ...), and commands such as ip, ss, free and systemctl do not exist on macOS.
How do I see what a command's flags mean on my system?
Run man command (for example man tar) to open the full manual, or command --help for a shorter summary. Press q to leave man. The tldr tool, if installed, shows short practical examples.
What does sudo do?
sudo runs a single command as the root (administrator) user after asking for your own password, if your account is allowed to. Use it only for commands that really need system-wide access, such as installing packages or editing files in /etc.
Is rm -rf dangerous?
Yes. rm -r deletes folders recursively and -f skips all confirmations, and there is no recycle bin in the terminal. Double-check the path, avoid variables that could be empty, and never run it on / or ~ by mistake. Use rm -ri when you want to confirm each file.
What is the difference between > and >> in bash?
> redirects output to a file and overwrites anything already in it. >> appends the output to the end of the file. Use 2> to redirect error messages and &> (bash) to send both output and errors to the same file.
How do I find which process is using a port?
Run sudo ss -ltnp | grep :8080 or sudo lsof -i :8080, replacing 8080 with your port. Both show the program name and process ID, which you can then stop with kill PID.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.