Essential Linux Commands for Developers

bash Beginner 👁️ 3,944 views By system Added Just now

Collection of useful Linux commands for daily development

0
bash Code
# File Operations
ls -la                      # List all files with details
find . -name "*.php"        # Find PHP files
grep -r "function" ./       # Search for text in files
sed -i "s/old/new/g" file   # Replace text in file
awk "{print $1}" file       # Print first column

# Process Management
ps aux | grep nginx         # Find nginx processes
top                         # Live process viewer
htop                        # Enhanced process viewer
kill -9 PID                 # Force kill process
nohup command &             # Run command in background

# System Info
df -h                       # Disk usage
du -sh *                    # Directory sizes
free -h                     # Memory usage
uname -a                    # System info
lscpu                       # CPU info

# Networking
curl -I https://example.com # Get HTTP headers
wget https://example.com    # Download file
netstat -tulpn              # Open ports
ss -tulpn                   # Socket stats (modern)
ping -c 4 google.com        # Test connectivity
traceroute google.com       # Trace network path

# Permissions
chmod 755 script.sh         # Set permissions
chown user:file file        # Change owner
umask                       # View default permissions

# Compression
tar -czf archive.tar.gz dir/    # Create tar.gz
tar -xzf archive.tar.gz         # Extract tar.gz
zip -r archive.zip dir/         # Create zip
unzip archive.zip               # Extract zip

# Text Editors
vim file.txt                # Open in vim
nano file.txt               # Open in nano
tail -f log.txt             # Follow log file
less large.txt              # View large file

# SSH
ssh user@host               # Connect to remote
scp file user@host:/path/   # Copy file
rsync -av src/ dest/        # Sync directories

# Package Management (Ubuntu/Debian)
apt update                  # Update package list
apt upgrade                 # Upgrade packages
apt install package         # Install package
apt remove package          # Remove package

# Git
git status                  # Check status
git log --oneline           # Compact log
git branch -a               # List branches
git diff                    # Show changes

Explanation

This comprehensive collection covers essential Linux commands for developers. From file operations and process management to networking and package management, these commands are fundamental for server administration and development workflows.