Most Used Linux Commands for Development
This article lists the essential Linux commands for developers in daily work, including file editing, process control, networking, debugging, Git operations, and container management. These commands are universally used across backend, frontend, DevOps, and scripting development.
Format Description
NOTEStandard identifiers for understanding command syntax:
| Identifier | Description |
|---|---|
$ | Terminal command prompt |
| Bold | Core command |
| Italic | Custom parameter |
| filename | File name (with extension optional) |
| dir | Directory path |
| port | Network port number |
| pid | Process ID |
| url | Web address |
| branch | Git branch name |
| env | Environment variable |
Command Help & System Info
TIPQuickly get help and check system environment for development setup
man command # View full command manualhelp command # Get help for shell built-in commandswhich command # Locate executable binary pathuname -a # Show OS, kernel, architecturelsb_release -a # Check Linux distribution versionhostname # Show current machine hostnamedate # Show system time (critical for log debugging)File & Directory Operations (Most Used)
NOTEFoundation for code management, configuration editing, and project navigation
ls -la # List all files (including hidden) with detailscd dir # Navigate to directorycd .. # Go back to parent directorypwd # Print current working pathmkdir -p dir # Create nested directoriestouch filename # Create empty file / update timestampcp -r src dest # Copy files/directories recursivelymv src dest # Move/rename filesrm -rf dir # Force delete files/dirs (use carefully)cat filename # View short file contentless filename # View large files (scrollable, searchable)tail -f filename # Real-time log monitoring (essential for debugging)wc -l filename # Count lines in code/log filesdu -sh . # Check current directory sizeText Editing & Search
TIPCritical for code editing, log analysis, and config modification
vim filename # Edit file (Vim editor)nano filename # Simple editor for beginnersgrep -rn "keyword" . # Recursively search keyword in current directorygrep -i "key" file # Case-insensitive searchfind . -name "*.js" # Find all JS files in projectsed -i 's/old/new/g' file # Replace text in file (batch edit)diff file1 file2 # Compare two code/config filesPermissions & Ownership
NOTECommonly used for server config, web servers, and script execution
chmod +x script.sh # Make script executablechmod 755 file # Set read/write/execute permissionschown user:group file # Change file owner/groupsudo command # Run command as root (privileged operations)Process Management
WARNINGEssential for starting/stopping services, debugging hanging applications
ps aux # List all running processesps aux | grep node # Find Node.js/any app processtop # Real-time process resource monitorhtop # Enhanced process viewer (better than top)kill pid # Terminate process gracefullykill -9 pid # Force kill unresponsive processpkill process_name # Kill process by namejobs # Show background tasksbg # Move paused process to backgroundfg # Bring background process to foregroundPort & Network Operations
NOTEUsed for API testing, server debugging, and connection checks
ping host # Test network connectivitycurl url # Send HTTP request (test APIs)curl -I url # Show response headers onlynetstat -tulpn # Check open ports and processesss -tulpn # Modern alternative to netstatlsof -i :port # Check which process uses a specific portwget url # Download files/resourcesscp file user@host:path # Secure file transfer to serverEnvironment Variables
env # List all environment variablesecho $PATH # View PATH variableexport VAR=value # Set temporary env varsource ~/.bashrc # Reload shell config (apply permanent env vars)Disk & System Monitoring
df -h # Check disk usagefree -h # Check memory usageiostat # Monitor disk I/O performanceuptime # Check system load and uptimeGit Commands (Development Core)
TIPIndispensable for version control in team development
git init # Initialize Git repogit clone url # Clone remote repositorygit status # Check file changesgit add . # Stage all changesgit commit -m "msg" # Commit changesgit push # Push to remote branchgit pull # Pull latest codegit branch # List local branchesgit checkout branch # Switch branchgit merge branch # Merge branchgit log # View commit historygit diff # Check uncommitted code changesContainer & DevOps (Modern Development)
NOTEWidely used in microservices, cloud, and local development environments
docker ps # List running containersdocker ps -a # List all containersdocker images # List local imagesdocker run image # Start containerdocker stop container # Stop containerdocker rm container # Delete containerdocker exec -it container bash # Enter container shelldocker-compose up -d # Start services in backgrounddocker-compose logs -f # View container logsScripting & Automation
bash script.sh # Run shell script./script.sh # Run executable scriptcrontab -l # List scheduled taskscrontab -e # Edit cron jobs (automate tasks)Package Management
apt update && apt install pkg # Debian/Ubuntu package installyum install pkg # CentOS/RHEL package installbrew install pkg # macOS package installnpm install pkg # Node.js package installpip install pkg # Python package installSummary
This collection includes developer-focused Linux commands that cover daily coding, debugging, server operations, Git version control, and container management. Mastering these commands will significantly improve your efficiency in development and server maintenance.