Linux Commands Cheat Sheet
Whether you are managing cloud virtual machines on AWS or GCP, setting up local Docker containers, or configuring CI/CD pipelines, Linux is the operating system backbone of modern software engineering and DevOps infrastructure. Mastering the command line is essential for efficient system navigation, file manipulation, and process management.
This comprehensive, developer-focused Linux Commands Cheat Sheet covers essential terminal workflows ranging from directory navigation and file permissions to process control, networking, and text processing.
1. File System Navigation and Inspection
Navigate directory trees, inspect file sizes, and search directories efficiently.
# Print working directory path
pwd
# List files with detailed permissions and hidden files
ls -la
# Change directory
cd /var/www/html
# Find files by name across a directory tree
find /etc -name "*.conf"
# Search for text patterns inside files (grep)
grep -rn "connection_string" /app/config/
2. File and Directory Management
Create, copy, move, and remove files and folders directly from the terminal.
# Create a new directory and nested parent folders
mkdir -p /var/log/app_logs
# Copy files or recursive directories
cp -r source_dir/ backup_dir/
# Move or rename files
mv old_name.txt new_name.txt
# Remove files or recursive directories securely
rm -rf obsolete_folder/
3. File Permissions and Ownership (chmod, chown)
Manage read, write, and execute permissions and user/group ownership for security hardening.
# Grant read, write, and execute permissions to owner, read/execute to others
chmod 755 script.sh
# Recursively make a shell script executable
chmod +x deploy.sh
# Change file owner and group
sudo chown -R ubuntu:www-data /var/www/html
4. Process Management and System Monitoring
Monitor active CPU/memory resource utilization and terminate runaway background processes.
# Real-time system resource monitor
top
# Or modern interactive viewer:
htop
# List running processes filtered by name
ps aux | grep node
# Terminate a process gracefully by Process ID (PID)
kill 1425
# Force kill a stubborn process immediately
kill -9 1425
5. Networking, Diagnostics, and Transfer (curl, netstat, ssh)
Diagnose network connections, test HTTP endpoints, and manage remote secure shell sessions.
# Test server connectivity and latency
ping google.com
# Make HTTP requests and inspect headers
curl -I https://codecrown.in
# Check active listening ports and network sockets
sudo ss -tulpn
# Connect to a remote server via SSH
ssh -i ~/.ssh/id_rsa ubuntu@192.168.1.50
Conclusion
Keep this Linux commands reference cheat sheet handy to streamline your server administration workflows, troubleshoot container environments, and manage system operations efficiently.