Linux Commands
Files & Navigation
ls -la—List all with details
cd /path—Change directory
pwd—Print working dir
mkdir -p dir—Create dir (nested)
cp src dest—Copy file
cp -r src dest—Copy directory
mv src dest—Move / rename
rm file—Delete file
rm -rf dir—Delete dir recursively
touch file—Create empty file
ln -s target link—Create symlink
tree -L 2—Show dir tree
File Content
cat file—Print file content
less file—Scrollable viewer
head -n 20 file—First 20 lines
tail -n 20 file—Last 20 lines
tail -f file—Follow file updates
wc -l file—Count lines
sort file—Sort lines
uniq—Remove duplicates
diff a b—Compare files
cut -d: -f1—Extract columns
Search & Find
find . -name "*.js"—Find by name
find . -type f -mtime -1—Modified today
grep "pattern" file—Search in file
grep -r "pat" dir—Recursive search
grep -i—Case insensitive
grep -n—Show line numbers
which cmd—Locate command
locate file—Fast file search
Permissions
chmod 755 file—rwxr-xr-x permission
chmod +x file—Make executable
chown user:grp file—Change owner
chown -R user dir—Recursive ownership
r=4 w=2 x=1—Permission values
sudo cmd—Run as superuser
Process Management
ps aux—List all processes
top / htop—Live process monitor
kill PID—Terminate process
kill -9 PID—Force kill
killall name—Kill by name
bg / fg—Background / foreground
nohup cmd &—Run after logout
jobs—List background jobs
Disk & System
df -h—Disk space usage
du -sh dir—Directory size
free -h—Memory usage
uname -a—System info
uptime—System uptime
whoami—Current user
hostname—Machine name
lsblk—List block devices
Networking
curl URL—HTTP request
wget URL—Download file
ping host—Test connectivity
ssh user@host—Remote login
scp file user@host:path—Secure copy
netstat -tulpn—Open ports
ss -tulpn—Socket stats (modern)
ip addr—Network interfaces
Archives & Compression
tar -czf a.tar.gz dir—Create gzip archive
tar -xzf a.tar.gz—Extract gzip archive
tar -xf archive.tar—Extract tar
zip -r a.zip dir—Create zip archive
unzip a.zip—Extract zip
gzip / gunzip—Compress / decompress
Piping & Redirection
cmd > file—Redirect stdout to file
cmd >> file—Append to file
cmd 2> err.log—Redirect stderr
cmd1 | cmd2—Pipe output
cmd < file—Input from file
cmd &> /dev/null—Discard all output
tee file—Write & pass through
xargs cmd—Build args from stdin
allprintabledoc.com