A practical guide to the essential Linux commands that make daily development a breeze.
As developers, the terminal is our second home. While graphical interfaces are great for many things, absolutely nothing beats the raw speed and power of the Linux command line. Over the years, I've noticed that while there are thousands of commands available, a very small subset accounts for 99% of my daily usage.
Here is a practical, no-nonsense guide to the Linux commands I actually reach for every single day.
grep (Global Regular Expression Print)Finding things inside files is a constant necessity. grep is the undisputed king of text search.
# Search for a specific string in a file
grep "error" /var/log/syslog
# Search recursively through a directory, ignoring case sensitivity
grep -ri "api_key" ./src
# Show context (2 lines before and after the match)
grep -C 2 "function init" main.jsfindWhen you need to find files rather than content, find is your best friend. It's incredibly powerful when combined with execution flags.
# Find all .log files modified in the last 7 days
find /var/logs -name "*.log" -mtime -7
# Find and delete all node_modules folders (use with extreme caution!)
find . -name "node_modules" -type d -exec rm -rf {} +tail and lessViewing logs is a daily chore for backend developers. tail -f lets you watch a log file update in real-time.
# Watch a log file continuously as new lines are added
tail -f /var/log/nginx/access.log
# View only the last 100 lines of a massive file
tail -n 100 app.logWhen you need to scroll through a large file, less is infinitely better than cat because it doesn't load the entire file into memory and allows for two-way scrolling and searching.
awkawk is basically a full programming language for text processing, but I primarily use it to extract specific columns from structured command output.
# Print only the 2nd column (e.g., process IDs) from the output of ps
ps aux | awk '{print $2}'sed (Stream Editor)Perfect for quick, automated find-and-replace operations across multiple files without opening an editor.
# Replace 'foo' with 'bar' globally in a file
sed -i 's/foo/bar/g' config.txthtop / topWhen your machine sounds like an airplane taking off, you need to know what's eating your CPU. htop is a visually appealing, interactive process viewer that makes it easy to spot and kill rogue processes.
df and duEssential for managing disk space when a server randomly runs out of storage.
# Show overall disk usage on all mounted filesystems (human readable)
df -h
# See exactly which folders are taking up the most space in the current directory
du -sh * | sort -hrcurlTesting APIs from the command line is significantly faster than opening Postman for simple requests.
# Fetch HTTP headers only (great for checking if a site is up)
curl -I https://api.github.com
# Send a POST request with a JSON payload
curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' http://localhost:3000/apilsofEver tried to start a development server and got the dreaded Address already in use error? lsof to the rescue.
# Find exactly what process is listening on port 8080
lsof -i :8080You don't need to be a bash wizard writing 50-line shell scripts to be highly productive in the terminal. Mastering just these core commands will significantly speed up your workflow, server management, and debugging processes. The next time you reach for a GUI tool, try to see if you can accomplish the task with these commands instead!