mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4
45 words
1 minute
Mastering the Linux Command Line

File Navigation#

# Move around
cd /var/log # Absolute path
cd ../ # Go up one level
cd - # Go to previous directory
cd ~ # Go home
# List files
ls -la # Long format with hidden files
ls -lhS # Sort by size, human-readable
tree -L 2 # Tree view, 2 levels deep

File Operations#

# Copy, move, remove
cp -r src/ backup/ # Copy directory recursively
mv old.txt new.txt # Rename / move
rm -rf node_modules/ # Remove recursively (⚠️ careful)
# Create
mkdir -p a/b/c # Create nested directories
touch file.txt # Create empty file

Text Processing Power Tools#

grep -rn "TODO" src/ # Recursive search with line numbers
grep -i "error" app.log # Case insensitive
grep -v "debug" app.log # Invert match (exclude)
grep -c "error" app.log # Count matches

sed — Find and Replace#

sed -i 's/old/new/g' file.txt # Replace in-place
sed -n '10,20p' file.txt # Print lines 10-20
sed '/^$/d' file.txt # Delete empty lines

awk — Column Processing#

awk '{print $1, $3}' data.txt # Print columns 1 and 3
awk -F: '{print $1}' /etc/passwd # Custom delimiter
awk '$3 > 100' data.txt # Filter by condition

Process Management#

ps aux | grep node # Find processes
top # Interactive process viewer
htop # Better interactive viewer
kill PID # Graceful termination
kill -9 PID # Force kill
# Background jobs
long-running-command & # Run in background
nohup ./script.sh & # Survive terminal close
jobs # List background jobs

Disk and Memory#

df -h # Disk space (human-readable)
du -sh */ # Directory sizes
free -h # Memory usage

Networking#

curl -s https://api.example.com | jq . # Fetch + pretty JSON
wget -O file.zip https://example.com/f.zip # Download file
ss -tulnp # Open ports
ping -c 4 google.com # Connectivity check

Productivity Combos#

# Find large files
find / -type f -size +100M 2>/dev/null
# Watch a log in real time
tail -f /var/log/syslog | grep --color error
# Count lines of code
find src -name "*.ts" | xargs wc -l | tail -1
# Quick HTTP server
python3 -m http.server 8080

The 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/
Author
LeviFREE
Published at
2026-06-25
License
CC BY-NC-SA 4.0

Some information may be outdated

Table of Contents