Advanced Linux Command List: What Every Experienced User Should Know

4 min read
Linux Cheat Sheet: Essential Commands for Power Users
This cheat sheet covers file operations, permissions, process management, networking, searching, compression, SSH, and more. Bookmark this for quick reference!
๐ File Operations
Command | Description | Example |
ls | List files | ls -la (detailed list) |
cd | Change directory | cd /var/log |
cp | Copy files | cp file.txt /backup/ |
mv | Move/rename | mv old.txt new.txt |
rm | Remove files | rm -rf dir/ (โ ๏ธ Caution!) |
touch | Create empty file | touch newfile.txt |
mkdir | Create directory | mkdir new_folder |
cat | Display file content | cat file.txt |
less | View file page-by-page | less large.log |
tail | Show last lines | tail -f logfile (follow updates) |
head | Show first lines | head -n 10 file.txt |
๐ Permissions (chmod
, chown
)
Understanding rwx
(Read, Write, Execute)
Symbol | Permission | Numeric Value |
r | Read | 4 |
w | Write | 2 |
x | Execute | 1 |
Common Commands
Command | Description | Example |
chmod | Change permissions | chmod 755 script.sh |
chown | Change owner | chown user:group file.txt |
umask | Set default permissions | umask 022 |
๐ Process Management
Command | Description | Example |
ps | List processes | ps aux (all processes) |
top | Interactive process viewer | top |
htop | Enhanced top (install via apt install htop ) | htop |
kill | Terminate process | kill -9 PID (force kill) |
pkill | Kill by name | pkill -f "nginx" |
bg | Send process to background | bg %1 |
fg | Bring process to foreground | fg %1 |
jobs | List background jobs | jobs |
๐ง System Information
Command | Description | Example |
free | Memory usage | free -h (human-readable) |
df | Disk space | df -h |
du | Directory size | du -sh /var/log/ |
uname | Kernel info | uname -a |
uptime | System uptime | uptime |
lscpu | CPU info | lscpu |
lsblk | List block devices | lsblk |
๐ Network Utilities
Command | Description | Example |
ping | Test connectivity | ping google.com |
ifconfig | Network interfaces (deprecated, use ip ) | ifconfig |
ip | Modern network config | ip a (show IPs) |
netstat | Network stats | netstat -tulnp (list open ports) |
ss | Socket statistics | ss -tulnp |
wget | Download files | wget https://example.com/file.zip |
curl | HTTP requests | curl -O https://example.com/file.zip |
dig | DNS lookup | dig google.com |
whois | Domain info | whois example.com |
traceroute | Network path tracing | traceroute google.com |
๐ Searching & Text Processing
Command | Description | Example |
grep | Search text | grep "error" logfile |
find | Search files | find / -name "*.log" |
locate | Fast file search (requires updatedb ) | locate nginx.conf |
awk | Text processing | awk '{print $1}' file.txt |
sed | Stream editor | sed 's/old/new/g' file.txt |
๐ฆ Compression & Archiving
Command | Description | Example |
tar | Archive files | tar -czvf archive.tar.gz /folder/ |
gzip | Compress files | gzip file.txt |
gunzip | Decompress files | gunzip file.txt.gz |
zip | Create ZIP archive | zip archive.zip file1 file2 |
unzip | Extract ZIP | unzip archive.zip |
๐ SSH Tips & Shortcuts
Command | Description | Example |
ssh | Connect to remote server | ssh user@host |
scp | Secure copy | scp file.txt user@host:/path/ |
rsync | Sync files | rsync -avz /local/ user@host:/remote/ |
ssh-keygen | Generate SSH keys | ssh-keygen -t ed25519 |
~/.ssh/config | SSH shortcuts | Add: Host myserver |
HostName 1.2.3.4
User root
|
โก Common Shortcuts
Shortcut | Description |
Ctrl+C | Kill process |
Ctrl+Z | Suspend process |
Ctrl+D | Exit shell |
Ctrl+R | Reverse search history |
!! | Repeat last command |
!$ | Last argument of previous command |
โ Conclusion
This cheat sheet covers 90% of daily Linux tasks. Keep it handy and master the terminal!
Want more?
Learn Bash scripting (
for
,if
,while
loops).Explore systemd (
systemctl start/stop/restart
).Dive into log analysis (
journalctl
,grep
).
Happy Learningโฆ
0
Subscribe to my newsletter
Read articles from Bhashkar Kushwaha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
