45 words
1 minute
Mastering the Linux Command Line
File Navigation
# Move aroundcd /var/log # Absolute pathcd ../ # Go up one levelcd - # Go to previous directorycd ~ # Go home
# List filesls -la # Long format with hidden filesls -lhS # Sort by size, human-readabletree -L 2 # Tree view, 2 levels deepFile Operations
# Copy, move, removecp -r src/ backup/ # Copy directory recursivelymv old.txt new.txt # Rename / moverm -rf node_modules/ # Remove recursively (⚠️ careful)
# Createmkdir -p a/b/c # Create nested directoriestouch file.txt # Create empty fileText Processing Power Tools
grep — Search
grep -rn "TODO" src/ # Recursive search with line numbersgrep -i "error" app.log # Case insensitivegrep -v "debug" app.log # Invert match (exclude)grep -c "error" app.log # Count matchessed — Find and Replace
sed -i 's/old/new/g' file.txt # Replace in-placesed -n '10,20p' file.txt # Print lines 10-20sed '/^$/d' file.txt # Delete empty linesawk — Column Processing
awk '{print $1, $3}' data.txt # Print columns 1 and 3awk -F: '{print $1}' /etc/passwd # Custom delimiterawk '$3 > 100' data.txt # Filter by conditionProcess Management
ps aux | grep node # Find processestop # Interactive process viewerhtop # Better interactive viewer
kill PID # Graceful terminationkill -9 PID # Force kill
# Background jobslong-running-command & # Run in backgroundnohup ./script.sh & # Survive terminal closejobs # List background jobsDisk and Memory
df -h # Disk space (human-readable)du -sh */ # Directory sizesfree -h # Memory usageNetworking
curl -s https://api.example.com | jq . # Fetch + pretty JSONwget -O file.zip https://example.com/f.zip # Download filess -tulnp # Open portsping -c 4 google.com # Connectivity checkProductivity Combos
# Find large filesfind / -type f -size +100M 2>/dev/null
# Watch a log in real timetail -f /var/log/syslog | grep --color error
# Count lines of codefind src -name "*.ts" | xargs wc -l | tail -1
# Quick HTTP serverpython3 -m http.server 8080The command line is the developer’s superpower. These commands will cover 90% of your daily terminal needs.
Share
If this article helped you, please share it with others!
Mastering the Linux Command Line
https://blog.levifree.com/posts/mastering-linux-command-line/ Some information may be outdated
Related Posts Smart
1
VS Code: Keyboard Shortcuts and Productivity Tips
Developer Tools Level up your VS Code workflow with essential keyboard shortcuts, extensions, and settings that will make you significantly more productive.
2
SSH Key Management: A Complete Guide
Security Everything you need to know about SSH keys — generating, managing, and using them securely for server access and Git authentication.
3
Setting Up a Home Lab: A Beginner's Guide
Home Lab Build your own home lab for learning, self-hosting, and experimentation. From hardware choices to software stacks and network configuration.
4
Getting Started with Astro: The Modern Static Site Generator
Web Dev A beginner-friendly introduction to Astro, covering its island architecture, content collections, and why it's becoming a go-to choice for content-focused websites.
5
Nginx Reverse Proxy: The Complete Setup Guide
DevOps Configure Nginx as a reverse proxy with SSL, load balancing, caching, and security headers. A production-ready setup guide.
Random Posts Random
1
Regex Cheat Sheet for Developers
Programming 2026-05-24
2
Setting Up a Home Lab: A Beginner's Guide
Home Lab 2026-05-12
3
Docker for Beginners: Containerize Everything
DevOps 2026-07-07
4
SSH Key Management: A Complete Guide
Security 2026-06-28
5
PostgreSQL: Essential Queries and Tips
Backend 2026-06-10





