45 Essential Linux Command Combos for Everyday Ops: Boost Efficiency
A concise collection of 45 high‑impact Linux command combinations, organized by seven common operational scenarios, equips sysadmins to handle roughly 99% of daily tasks ranging from file manipulation to network troubleshooting and log analysis.
This guide compiles 45 high‑efficiency Linux command combinations covering seven frequent operational scenarios, which can address about 99% of daily sysadmin tasks.
✅ 1. Batch File Operations
Batch creation: touch haodao{1..100}.py
Quickly generate large files: dd if=/dev/zero of=test.txt bs=1M count=1024
Five ways to empty a file: > file , truncate -s 0 file , cat /dev/null > file , etc.
✅ 2. Advanced find Search & Cleanup
Search by name, type, permission, size, or time: find . -name "*.py" (by suffix) find . -type f -perm 777 (by permission) find . -size +100M -size -1G (by size range) find . -mtime +7 -name "*.py" | xargs rm -rf (by time + name)
✅ 3. System Resource Monitoring
View CPU model and core count: cat /proc/cpuinfo | grep name | uniq -c
Top 20 memory/CPU consuming processes: ps aux | sort -rnk 4 | head -20 ps aux | sort -rnk 3 | head -20
Run command in background: nohup cmd > /dev/null 2>&1 &
✅ 4. Log and Access Analysis
Tomcat log analysis examples: awk '{print $4,$1}' access.log | grep "11/Dec/2022:09" (count IPs in a time window) awk '{print $1}' access.log | sort | uniq -c | sort -nr | head -20 (top 20 IPs) grep ^IP access.log | awk '{print $7}' (pages visited by an IP)
✅ 5. Text Processing & Replacement
sed tricks: Replace string: sed -i 's/haodao/HAODAO/g' file.py Replace path: sed -i 's:/etc/dhcp:/home:g' file.py Add/remove content at line start/end, delete comments, insert before/after specific lines, etc.
✅ 6. Network Capture & Port Analysis
Precise tcpdump capture: Capture specific port: tcpdump -i ens33 port 8080 -n Capture IP range: tcpdump portrange 80-443 -i ens33 -n Capture ICMP from source IP: tcpdump icmp and src 192.168.20.231 -i ens33 -n
Top IPs connecting to a port: netstat -anlp | grep 80 | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr | head -15
✅ 7. Disk & Directory Cleanup
Find large files in /var: du -xBM --max-depth=2 /var | sort -rn | head -20
Top 10 large files in current directory: du -s * | sort -n | tail
✅ One‑Sentence Summary
45 command combos form a full‑stack ops toolbox—file handling, system monitoring, log analysis, network troubleshooting, text processing, disk cleanup, and packet filtering—that can solve about 99% of everyday Linux administration scenarios.
Linux Cloud Computing Practice
Welcome to Linux Cloud Computing Practice. We offer high-quality articles on Linux, cloud computing, DevOps, networking and related topics. Dive in and start your Linux cloud computing journey!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
