Essential Linux Commands for DevOps Engineers
This guide covers the "daily driver" commands that go beyond basic navigation, focusing on troubleshooting, resource monitoring, and automation.
As a DevOps engineer, the terminal is your home. Whether you are debugging a crashing container, analyzing HTTP traffic, or managing file permissions, mastery of the command line is non-negotiable.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Standard top
top
# Interactive, color-coded alternative (install via package manager)
htop
# Check overall disk usage
df -h
# Find which folder is eating your space
du -sh /var/log/*
# Display memory in human-readable format
free -h
# verbose mode to see the handshake and headers
curl -v [https://api.example.com/health](https://api.example.com/health)
# Show only the HTTP response headers
curl -I [https://google.com](https://google.com)
# List processes listening on a specific port (e.g., 8080)
lsof -i :8080
# List all open files by a specific user
lsof -u jenkins
# Show all listening TCP and UDP ports with numeric addresses
ss -tulpn
# Follow a log file in real-time (essential for debugging deployments)
tail -f /var/log/nginx/error.log
# View the last 100 lines
tail -n 100 /var/log/syslog
# Search for "error" in a file, ignoring case (-i)
grep -i "error" application.log
# Recursive search in a directory
grep -r "db_password" /opt/app/config/
# Print only the 1st and 9th columns (e.g., IP and Status Code from access logs)
awk '{print $1, $9}' access.log
# Give execution rights to a script (User: Read/Write/Exec)
chmod u+x deploy.sh
# Standard web permission (Owner: RWX, Group: RX, Others: RX)
chmod 755 /var/www/html
# Change owner to 'ubuntu' and group to 'www-data' recursively
chown -R ubuntu:www-data /var/www/html
This post is licensed under CC BY 4.0 by the author.