惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
I
InfoQ
V
Visual Studio Blog
M
MIT News - Artificial intelligence
H
Help Net Security
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
A
About on SuperTechFans
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
WordPress大学
WordPress大学

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
30 Linux Commands Every Developer Should Know
Alex Chen · 2026-05-16 · via DEV Community

Alex Chen

30 Linux Commands Every Developer Should Know

These are the commands I use every single day on my VPS.

File Operations

# Find files by name
find . -name "*.js" -type f
find /var/log -name "*.log" -mtime -7    # Modified in last 7 days

# Search file contents
grep -r "TODO" src/                       # Recursive search
grep -rn "function" src/                  # With line numbers
grep -r "error" /var/log/ --include="*.log" # In specific files only

# Quick find (faster than find for name searches)
locate config.json                        # Updatedb first
fd pattern src/                           # Install: apt install fd-find

# Better grep (ripgrep)
rg "TODO" src/                            # Faster, ignores .gitignore

Enter fullscreen mode Exit fullscreen mode

Disk & Memory

# Disk usage
df -h                                     # Human-readable disk usage
du -sh *                                  # Directory sizes in current folder
du -sh /var/* | sort -hr | head -10       # Top 10 largest directories

# Find large files
find . -size +100M -type f                # Files > 100MB
find . -size +1G -exec ls -lh {} \;       # Show details of huge files

# Memory
free -h                                   # RAM usage
top                                       # Process resource usage (or htop)
ps aux | sort -k4nr | head -10            # Top 10 memory-hungry processes

Enter fullscreen mode Exit fullscreen mode

Network

# Port checking
ss -tlnp | grep :3000                     # What's listening on port 3000?
netstat -tlnp                             # All listening ports

# Connection testing
curl -I https://example.com               # Headers only
curl -s -o /dev/null -w "%{http_code}" URL # Just status code
wget -qO- https://ifconfig.me             # Your public IP

# DNS
dig example.com                            # DNS lookup
nslookup example.com                      # Alternative DNS check
host example.com                          # Simple DNS query

# Debug connectivity
ping -c 4 google.com                      # 4 pings
traceroute google.com                     # Route to destination
telnet host 80                            # Test TCP connection
nc -zv localhost 3000                     # Check if port is open

Enter fullscreen mode Exit fullscreen mode

Process Management

# Find and kill
ps aux | grep node                        # Find node processes
kill 12345                                # Graceful kill
kill -9 12345                             # Force kill
pkill -f "node server.js"                # Kill by pattern

# Background processes
node server.js &                          # Run in background
jobs                                      # List background jobs
fg %1                                     # Bring job 1 to front
bg %1                                     # Resume suspended job in background
nohup node server.js &                   # Survives logout

# Monitor process
watch -n 2 'curl -s http://localhost:3000/health' # Repeat every 2 seconds
tail -f /var/log/app.log                 # Follow log file

Enter fullscreen mode Exit fullscreen mode

Text Processing

# View files
less bigfile.txt                          # Scrollable viewer (q to quit)
head -20 file.txt                         # First 20 lines
tail -50 file.txt                         # Last 50 lines
tail -f logfile.txt                       # Live follow

# Count
wc -l file.txt                            # Line count
wc -w file.txt                            # Word count
grep -c "error" logfile.txt              # Count matches

# Sort & unique
sort file.txt                             # Sort lines
sort -u file.txt                          # Unique lines
sort file.txt | uniq -c                   # Count occurrences
sort file.txt | uniq -c | sort -rn        # Sorted by frequency

# Extract columns
awk '{print $1, $3}' file.txt            # Print columns 1 and 3
cut -d',' -f2,5 csv.csv                  # CSV column extraction

# Replace
sed 's/old/new/g' file.txt               # Replace all occurrences
sed -i 's/foo/bar/g' file.txt            # In-place replace

# Chain commands together
cat access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
# Top 20 most requested URLs

Enter fullscreen mode Exit fullscreen mode

Archives

# tar.gz
tar -czvf archive.tar.gz folder/          # Create
tar -xzvf archive.tar.gz                  # Extract
tar -tzvf archive.tar.gz                  # List contents

# zip
zip -r archive.zip folder/               # Create
unzip archive.zip                         # Extract

# Quick extract anything
extract() {
  if [ -f $1 ]; then
    case $1 in *.tar.bz2) tar xjf $1 ;;
      *.tar.gz) tar xzf $1 ;;
      *.bz2) bunzip2 $1 ;;
      *.rar) unrar x $1 ;;
      *.gz) gunzip $1 ;;
      *.tar) tar xf $1 ;;
      *.tbz2) tar xjf $1 ;;
      *.tgz) tar xzf $1 ;;
      *.zip) unzip $1 ;;
      *) echo "Cannot extract '$1'" ;;
    esac
  fi
}

Enter fullscreen mode Exit fullscreen mode

User & Permissions

# Who am I?
whoami                                    # Current user
id                                        # User ID and groups
who                                       # Logged-in users
w                                         # Who's doing what

# Permissions
ls -la                                    # Detailed listing with permissions
chmod +x script.sh                        # Make executable
chmod 644 file.txt                        # rw-r--r--
chmod 755 script.sh                       # rwxr-xr-x
chown user:group file.txt                 # Change owner

# Sudo without password for specific command (be careful!)
sudo visudo → add: username ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart nginx

Enter fullscreen mode Exit fullscreen mode

System Info

uname -a                                  # Full system info
uname -m                                  # Architecture (x86_64/arm64)
cat /etc/os-release                      # OS version
uptime                                    # How long system has been running
lscpu                                     # CPU info
lsblk                                     # Block devices (disks)
free -h                                   # Memory
ip addr                                   # Network interfaces
systemctl status nginx                    # Service status
journalctl -u nginx -f                    # Follow service logs

Enter fullscreen mode Exit fullscreen mode

My Daily Workflow Commands

# Deploy new code
cd /app && git pull origin main && npm run build && pm2 restart app

# Check what's eating disk
du -sh /* 2>/dev/null | sort -hr | head -10

# Quick backup
tar -czvf backup-$(date +%Y%m%d).tar.gz important_folder/

# Monitor a deploy
pm2 logs app --lines 50

# Fix permissions after deploy
chown -R www-data:www-data /app/public
chmod -R 755 /app/public

# Quick port check
ss -tlnp | grep -E '(3000|8080|443)'

# Find and delete old logs (>30 days)
find /var/log/app -name "*.log" -mtime +30 -delete

Enter fullscreen mode Exit fullscreen mode


What's your most-used Linux command? Did I miss any essentials?

Follow @armorbreak for more developer content.