pwd | Print working directory |
ls -la | List all files with details |
cd ~ | Go to home directory |
cd - | Go to previous directory |
find . -name "*.txt" | Find files by name |
locate filename | Find file in database |
cp -r src/ dst/ | Copy directory recursively |
mv file newname | Move or rename file |
rm -rf dir/ | Remove directory forcefully |
mkdir -p a/b/c | Create nested directories |
ln -s target link | Create symbolic link |
chmod 755 file | Set file permissions |
chown user:group f | Change file ownership |
cat file | Print file contents |
less file | Page through file |
head -n 20 file | First 20 lines |
tail -f file | Follow file updates |
grep -r "text" . | Search text recursively |
grep -v "text" | Exclude matching lines |
sed 's/old/new/g' | Replace text in stream |
awk '{print $1}' | Print first column |
ps aux | List all processes |
top | Interactive process viewer |
htop | Better process viewer |
kill -9 PID | Force kill process |
pkill name | Kill by name |
nohup cmd & | Run in background |
jobs | List background jobs |
fg %1 | Bring job to foreground |
curl -I url | HTTP headers only |
wget -c url | Download with resume |
ss -tunlp | Show open ports |
ping -c 4 host | Ping 4 times |
traceroute host | Trace network path |
dig domain | DNS lookup |
nmap -p 80 host | Scan specific port |
ssh -p 22 user@host | SSH connection |
uname -a | Kernel information |
df -h | Disk space usage |
du -sh dir/ | Directory size |
free -h | Memory usage |
uptime | System uptime & load |
lscpu | CPU information |
lsblk | Block devices list |
env | List environment vars |
cmd > file | Redirect stdout to file |
cmd >> file | Append stdout to file |
cmd 2>&1 | Redirect stderr to stdout |
cmd1 | cmd2 | Pipe output |
cmd1 && cmd2 | Run if previous succeeded |
cmd1 || cmd2 | Run if previous failed |
tee file | Output to file and stdout |
xargs | Build args from stdin |
tar -czf a.tar.gz dir/ | Create gzip archive |
tar -xzf a.tar.gz | Extract gzip archive |
tar -tf a.tar.gz | List archive contents |
zip -r a.zip dir/ | Create zip archive |
unzip a.zip | Extract zip archive |
gzip file | Compress single file |
VAR="value" | Set variable |
echo $VAR | Print variable |
export VAR | Export to environment |
$(command) | Command substitution |
${VAR:-default} | Default if unset |
if [ -f file ] | Check file exists |
for i in {1..5} | Loop 1 to 5 |
while read line | Read lines from stdin |
Ctrl+C | Interrupt current process |
Ctrl+Z | Suspend process |
Ctrl+D | End of input / logout |
Ctrl+L | Clear screen |
Ctrl+R | Search command history |
Ctrl+A | Move to line start |
Ctrl+E | Move to line end |
!! | Repeat last command |