Essential Bash commands for file ops, navigation, search, processes, networking, and permissions
ls # current directoryls -la # all files with detailsls -lh # human-readable sizesls *.txt # pattern match-a shows hidden files. -l long format. -h with -l for readable sizes.
cp file.txt dest/ # copy filecp -r dir/ dest/ # recursive copy directorycp -i file.txt bak/ # prompt before overwrite-r for directories. -v verbose. -i interactive (safe). -p preserve attributes.
mv file.txt newname.txt # renamemv file.txt /path/dir/ # movemv -i *.txt backup/ # interactive bulk-i (interactive) or -n (no-clobber) to prevent.
rm file.txt # remove filerm -r dir/ # remove directory recursivelyrm -rf dir/ # force, no prompts (DANGEROUS)rm -i *.log # prompt before each removalrm -rf is irreversible. Triple-check path. Use trash-cli for safer deletion.
mkdir newdirmkdir -p a/b/c # create nested
rmdir emptydirrmdir -p a/b # remove parents if empty
touch newfile.txt # create emptytouch file1 file2 file3 # multiple files-t option sets explicit timestamp.
cat file.txtcat f1 f2 > combined.txt
less longfile.logj/k scroll, q quit, /search
more file.txtspace next, Enter line
less for large files. cat is best for small files or piping.
pwd
cd /path/to/dircd .. # parentcd ~ # homecd - # previous dir
grep "pattern" file.txtgrep -r "TODO" . # recursive in current dirgrep -i "error" log.txt # case-insensitivegrep -n "fn" file.js # show line numbersgrep -v "debug" code.js # invert: exclude lines-r recursive. -i case-insensitive. -n line numbers. -v invert match (exclude).
find . -name "*.txt" # by name patternfind /var/log -type f # only filesfind . -size +10M # larger than 10 MBfind . -mtime -7 # modified in last 7 daysfind . -exec rm {} \; # execute on each result-name (case-sensitive), -iname (case-insensitive). -exec runs command on matches. {} is placeholder.
which nodewhich -a python # all matches
whereis gcc
ps aux # all processesps -ef | grep node # filter
topq to quit, M sort by mem
htop(install: apt/brew)
kill 1234 # SIGTERMkill -9 1234 # SIGKILL (force)
pkill -f "node app.js"
killall chrome
kill -9 (SIGKILL) does not allow graceful shutdown. Try kill (SIGTERM) first.
command & # start in backgroundjobs # list background jobsfg %1 # bring job 1 to foregroundbg %1 # resume job in backgroundCtrl+Z to suspend current foreground job, then bg or fg to resume.
chmod +x script.sh # add executechmod 755 app.js # rwxr-xr-xchmod 644 config.json # rw-r--r--chmod -R 755 dir/ # recursive755 = rwx (7) r-x (5) r-x (5)644 = rw- (6) r-- (4) r-- (4)
chown alice file.txt # change ownerchown alice:staff file.txt # owner and groupchown -R www-data:www-data /var/www # recursivecurl -O https://url/file.zipcurl -I https://site.com # headers only
wget URLwget -c file.zip # continue partial
ping google.comping -c 4 host # count=4
traceroute google.com
nslookup example.com
ss -tulpn # listening portsnetstat -tulpn # traditional (older)ss is modern replacement for netstat on Linux. -t TCP, -u UDP, -l listening, -p process.
df -h # human-readabledf -i # inode usage
du -sh dir/ # summary human-readabledu -h --max-depth=1 # per-subdir
free -h
uname -a # all detailsuname -r # kernel version
tar -cvf archive.tar dir/ # create tartar -xvf archive.tar # extracttar -czvf archive.tar.gz dir/ # create gzippedtar -xzvf archive.tar.gz # extract gzippedtar -tjvf archive.tar # list contents-c create, -x extract, -v verbose, -f file, -z gzip, -j bzip2.tar -zcvf = tar -czvf.
gzip file.txtgunzip file.txt.gz
zip -r out.zip dir/
unzip out.zip
gzip compresses files in-place (replaces original with .gz). Use tar for directories.
echo "text"echo $PATH # variable
head file.txthead -n 20 # 20 lines
tail -f logfile # follow livetail -n 50 # last 50 lines
wc file.txt # lines words byteswc -l file.txt # line count onlywc -w file.txt # word countls -1 | wc -l # count files in dirsort file.txtsort -r # reversesort -n # numeric
uniq sorted.txtsort file | uniq -c # count per value
uniq only removes adjacent duplicates. Pipe through sort first for full deduplication.
sed 's/old/new/g' file.txtsed -i 's/foo/bar/g' file # in-place
awk '{print $1}' fileawk -F: '{print $1}' /etc/passwd
sed 's/old/new/' replaces first occurrence. g flag = global (all). -i edits file in-place.
As we navigate the highly automated and cloud-native world of 2026, the Linux terminal remains the definitive interface for power users, developers, and system administrators. While graphical user interfaces have their place, the speed, precision, and scriptability of the command line are unmatched for managing servers, automating deployments, and processing large datasets. Our Linux Terminal Cheat Sheet provides a categorized, searchable reference for the most essential Bash and shell commands, helping you work more efficiently and with greater confidence across any Unix-like environment.
A major focus in 2026 is the role of "Terminal Proficiency" in DevOps and security. Professional developers prioritize the use of standard, portable commands for file manipulation (ls, cp, mv), search (grep, find), and process management (ps, kill). Our cheat sheet includes the most common flags and practical examples for each, ensuring you have the right tool for every task. By mastering these core utilities, you can significantly reduce your reliance on third-party software and build more resilient, high-performance systems.
Finally, consider the importance of "Local-First" privacy in your system administration workflows. At AllOmnitools, we believe your terminal habits and infrastructure details should remain private. Our Linux Cheat Sheet runs entirely in your browser, ensuring that your search queries and the commands you browse never leave your device. This approach provides zero-latency access to critical information, even in restricted or offline environments. By combining this cheat sheet with other AllOmnitools like the Crontab Descriptor, you have a complete ecosystem for mastering the digital infrastructure of 2026.
Zero server lag. All Linux commands and categories are searchable instantly for your workflow.
Your search queries and terminal preferences remain private. We never track or store your system data.
Shell is a general category of command-line interpreters. Bash (Bourne Again SHell) is a specific, widely used implementation that is the default on many Linux distributions and macOS.
Use the ls -a command. Files and directories starting with a dot (e.g., .bashrc) are considered hidden by default in Unix-like systems.
It sets permissions so the owner can read, write, and execute (7), while the group and others can only read and execute (5). It's a common setting for public scripts and directories.
Yes. AllOmnitools is "local-first." We provide the information and command examples locally in your browser. You never need to submit your proprietary system details to our servers.
The find . -name "filename.txt" command is the standard way to search for files recursively from your current directory.
Yes! Most commands in our cheat sheet are part of the POSIX standard and work perfectly on macOS, although some flags may differ slightly from the Linux versions.