DevOpsLinuxCLIProductivity
Essential Linux Commands for Web Developers
2.635 min read
Md Nasim Sheikh
You've built your app, but now you need to debug it on the production server. There is no VS Code here. Just a blinking cursor.
Here are the commands you actually need.
Advertisement
1. File Navigation & Manipulation
ls -lah: List all files, including hidden ones (.env), showing sizes in human-readable format (h).cd -: Go back to the previous directory. (Super useful).tail -f error.log: Watch the end of a file in real-time. Crucial for monitoring logs while hitting an API.
2. Process Management
Help! The server is slow.
htop: Interactive process viewer. Who is eating the CPU?kill -9 <PID>: Force kill a process ID. The nuclear option.ps aux | grep node: Find all running Node.js processes.
3. Network Debugging
curl -I https://google.com: Fetch headers only. Check if leading301 Redirector500 Error.netstat -tulpn(orss -tulpn): "What port is currently in use?" Used when you getEADDRINUSE: 3000.
4. Permissions
chmod +x script.sh: Make a file executable.chown -R user:group directory: Recursively change ownership.
Pro Tip: Chaining Commands
The pipe | is your friend. cat access.log | grep "404" | wc -l Read log -> Find 404s -> Count the lines.
Advertisement
Quiz
Quick Quiz
Which command would you use to follow the output of a log file in real-time as new lines are added?
Conclusion
You don't need to be a SysAdmin. But knowing how to read a log file (tail) and find a zombie process (top/htop) distinguishes a Junior from a Senior.
Written by
Md Nasim Sheikh
Software Developer at softexForge
Verified Author150+ Projects
Published: