Tools: Linux Commands Cheat Sheet: 50 Commands Every Developer Should Know (2026)
Linux Commands Cheat Sheet: 50 Commands Every Developer Should Know
File Navigation
File Operations
Viewing and Editing Files
Permissions
Process Management
Disk and Storage
Networking
Text Processing
Compression and Archives
System Info
Quick Reference by Task A good Linux command-line reference isn't nice to have — it's essential. This cheatsheet covers 50 commands organized by what you're actually trying to do, from file navigation to process management to networking. See also: Git Commands Cheat Sheet: The Only Reference You Need, [30 Free and Useful AP Read the full article on AI Study Room for complete code examples, comparison tables, and related resources. Found this useful? Check out more developer guides and tool comparisons on AI Study Room. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse
$ pwd # print working directory
ls -la # list all files with details
cd /path/to/dir # change directory
cd .. # go up one level
cd - # go back to previous directory
find . -name "*.py" # find files by name pattern
locate filename # find file quickly (uses indexed db)
pwd # print working directory
ls -la # list all files with details
cd /path/to/dir # change directory
cd .. # go up one level
cd - # go back to previous directory
find . -name "*.py" # find files by name pattern
locate filename # find file quickly (uses indexed db)
pwd # print working directory
ls -la # list all files with details
cd /path/to/dir # change directory
cd .. # go up one level
cd - # go back to previous directory
find . -name "*.py" # find files by name pattern
locate filename # find file quickly (uses indexed db)
cp source dest # copy file
cp -r source dest # copy directory recursively
mv source dest # move or rename
rm file # -weight: 500;">remove file
rm -rf dir # -weight: 500;">remove directory (DANGER — no undo)
mkdir -p a/b/c # create nested directories
touch file # create empty file or -weight: 500;">update timestamp
ln -s target link # create symbolic link
cp source dest # copy file
cp -r source dest # copy directory recursively
mv source dest # move or rename
rm file # -weight: 500;">remove file
rm -rf dir # -weight: 500;">remove directory (DANGER — no undo)
mkdir -p a/b/c # create nested directories
touch file # create empty file or -weight: 500;">update timestamp
ln -s target link # create symbolic link
cp source dest # copy file
cp -r source dest # copy directory recursively
mv source dest # move or rename
rm file # -weight: 500;">remove file
rm -rf dir # -weight: 500;">remove directory (DANGER — no undo)
mkdir -p a/b/c # create nested directories
touch file # create empty file or -weight: 500;">update timestamp
ln -s target link # create symbolic link
cat file # print entire file
less file # scroll through file (q to quit)
head -20 file # first 20 lines
tail -f file # follow file as it grows (logs)
wc -l file # count lines
grep "pattern" file # search for pattern
grep -r "pattern" dir # search recursively
nano file # simple terminal editor
vim file # advanced editor (:q! to quit)
cat file # print entire file
less file # scroll through file (q to quit)
head -20 file # first 20 lines
tail -f file # follow file as it grows (logs)
wc -l file # count lines
grep "pattern" file # search for pattern
grep -r "pattern" dir # search recursively
nano file # simple terminal editor
vim file # advanced editor (:q! to quit)
cat file # print entire file
less file # scroll through file (q to quit)
head -20 file # first 20 lines
tail -f file # follow file as it grows (logs)
wc -l file # count lines
grep "pattern" file # search for pattern
grep -r "pattern" dir # search recursively
nano file # simple terminal editor
vim file # advanced editor (:q! to quit)
chmod 755 script.sh # rwxr-xr-x (owner full, others read+execute)
chmod +x script.sh # make executable
chown user:group file # change owner and group
umask 022 # set default permissions mask
chmod 755 script.sh # rwxr-xr-x (owner full, others read+execute)
chmod +x script.sh # make executable
chown user:group file # change owner and group
umask 022 # set default permissions mask
chmod 755 script.sh # rwxr-xr-x (owner full, others read+execute)
chmod +x script.sh # make executable
chown user:group file # change owner and group
umask 022 # set default permissions mask
ps aux # list all running processes
ps aux | grep nginx # find specific process
top # real-time process monitor (q to quit)
htop # prettier top (-weight: 500;">install separately)
kill 1234 # terminate process by PID
kill -9 1234 # force kill (SIGKILL)
pkill -f pattern # kill by name pattern
bg # resume suspended job in background
fg # bring background job to foreground
jobs # list background jobs
ps aux # list all running processes
ps aux | grep nginx # find specific process
top # real-time process monitor (q to quit)
htop # prettier top (-weight: 500;">install separately)
kill 1234 # terminate process by PID
kill -9 1234 # force kill (SIGKILL)
pkill -f pattern # kill by name pattern
bg # resume suspended job in background
fg # bring background job to foreground
jobs # list background jobs
ps aux # list all running processes
ps aux | grep nginx # find specific process
top # real-time process monitor (q to quit)
htop # prettier top (-weight: 500;">install separately)
kill 1234 # terminate process by PID
kill -9 1234 # force kill (SIGKILL)
pkill -f pattern # kill by name pattern
bg # resume suspended job in background
fg # bring background job to foreground
jobs # list background jobs
df -h # disk free (human-readable)
du -sh dir # directory size summary
du -sh * | sort -h # size of each item, sorted
mount # show mounted filesystems
lsblk # list block devices
df -h # disk free (human-readable)
du -sh dir # directory size summary
du -sh * | sort -h # size of each item, sorted
mount # show mounted filesystems
lsblk # list block devices
df -h # disk free (human-readable)
du -sh dir # directory size summary
du -sh * | sort -h # size of each item, sorted
mount # show mounted filesystems
lsblk # list block devices
ping host # test connectivity
-weight: 500;">curl -I url # fetch headers only
-weight: 500;">curl -s url | jq # fetch JSON and pretty-print
-weight: 500;">wget url # download file
ssh user@host # connect to remote server
scp file user@host:path # copy file to remote
netstat -tlnp # listening ports
ss -tlnp # modern alternative to netstat
lsof -i :3000 # what's using port 3000
ping host # test connectivity
-weight: 500;">curl -I url # fetch headers only
-weight: 500;">curl -s url | jq # fetch JSON and pretty-print
-weight: 500;">wget url # download file
ssh user@host # connect to remote server
scp file user@host:path # copy file to remote
netstat -tlnp # listening ports
ss -tlnp # modern alternative to netstat
lsof -i :3000 # what's using port 3000
ping host # test connectivity
-weight: 500;">curl -I url # fetch headers only
-weight: 500;">curl -s url | jq # fetch JSON and pretty-print
-weight: 500;">wget url # download file
ssh user@host # connect to remote server
scp file user@host:path # copy file to remote
netstat -tlnp # listening ports
ss -tlnp # modern alternative to netstat
lsof -i :3000 # what's using port 3000
sed 's/old/new/g' file # replace all occurrences
awk '{{print $1}}' file # print first column
sort file # sort lines
sort -u file # sort and deduplicate
uniq -c file # count occurrences
cut -d',' -f1 file # extract column 1 from CSV
tr '[:lower:]' '[:upper:]' # convert case
sed 's/old/new/g' file # replace all occurrences
awk '{{print $1}}' file # print first column
sort file # sort lines
sort -u file # sort and deduplicate
uniq -c file # count occurrences
cut -d',' -f1 file # extract column 1 from CSV
tr '[:lower:]' '[:upper:]' # convert case
sed 's/old/new/g' file # replace all occurrences
awk '{{print $1}}' file # print first column
sort file # sort lines
sort -u file # sort and deduplicate
uniq -c file # count occurrences
cut -d',' -f1 file # extract column 1 from CSV
tr '[:lower:]' '[:upper:]' # convert case
tar -czf archive.tar.gz dir # create gzipped tarball
tar -xzf archive.tar.gz # extract gzipped tarball
gzip file # compress single file
gunzip file.gz # decompress
zip -r archive.zip dir # create zip
tar -czf archive.tar.gz dir # create gzipped tarball
tar -xzf archive.tar.gz # extract gzipped tarball
gzip file # compress single file
gunzip file.gz # decompress
zip -r archive.zip dir # create zip
tar -czf archive.tar.gz dir # create gzipped tarball
tar -xzf archive.tar.gz # extract gzipped tarball
gzip file # compress single file
gunzip file.gz # decompress
zip -r archive.zip dir # create zip
uname -a # kernel info
whoami # current user
who # who is logged in
uptime # how long system has been up
free -h # memory usage
date # current date/time
history # command history
!! # re-run last command
!$ # last argument of previous command
uname -a # kernel info
whoami # current user
who # who is logged in
uptime # how long system has been up
free -h # memory usage
date # current date/time
history # command history
!! # re-run last command
!$ # last argument of previous command
uname -a # kernel info
whoami # current user
who # who is logged in
uptime # how long system has been up
free -h # memory usage
date # current date/time
history # command history
!! # re-run last command
!$ # last argument of previous command