Essential Linux Commands for DevOps Engineers
Megha Shivhare

Megha Shivhare @megha_shivhare_5038dc1047

About: Learn. Create. Share.

Joined:
Nov 19, 2024

Essential Linux Commands for DevOps Engineers

Publish Date: Jan 19
36 12

As a DevOps engineer, mastering Linux commands is fundamental for managing infrastructure, automating tasks, and ensuring seamless deployments. This blog highlights critical Linux command categories that every DevOps professional should know.


1. Process Management

Process management is vital for controlling and monitoring applications running on Linux systems. Here are essential commands:

Key Commands and Their Usage:

List processes:

ps aux        # Shows all running processes
ps -ef        # Alternative format for process listing
ps -u username # Processes for a specific user
Enter fullscreen mode Exit fullscreen mode

Process monitoring:

top           # Interactive process viewer
htop          # Enhanced version with color coding and mouse support
Enter fullscreen mode Exit fullscreen mode

Process control:

kill PID      # Send SIGTERM to terminate a process
kill -9 PID   # Forcefully terminate a process
killall name  # Kill all processes by name
Enter fullscreen mode Exit fullscreen mode

Service management:

systemctl start service   # Start a service
systemctl stop service    # Stop a service
systemctl restart service # Restart a service
Enter fullscreen mode Exit fullscreen mode

Process priority management:

nice -n 10 command        # Start command with lower priority
renice -n 10 -p PID       # Adjust priority of a running process
Enter fullscreen mode Exit fullscreen mode

2. File System Management

Linux filesystems are organized in a tree structure. Managing files and directories is integral to system administration.

Key Commands and Their Usage:

File permissions:

chmod 755 file            # rwx for owner, rx for others
chown user:group file     # Change ownership
Enter fullscreen mode Exit fullscreen mode

File searching:

find / -type f -name "*.log"   # Find all log files
find / -mtime -7               # Files modified in the last 7 days
Enter fullscreen mode Exit fullscreen mode

Disk usage:

du -sh *                     # Size of directory contents
df -h                        # Filesystem usage
Enter fullscreen mode Exit fullscreen mode

3. Network Management

Network configuration and troubleshooting are key DevOps skills.

Key Commands and Their Usage:

Network connectivity:

ip addr      # Show IP addresses
ping -c 4 host # Test connectivity with 4 packets
Enter fullscreen mode Exit fullscreen mode

Port monitoring:

netstat -tulpn     # Show listening ports and processes
ss -tunlp          # Modern alternative to netstat
Enter fullscreen mode Exit fullscreen mode

Network debugging:

tcpdump -i eth0    # Capture packets on a network interface
nmap localhost     # Scan open ports
Enter fullscreen mode Exit fullscreen mode

4. System Monitoring

Monitoring system performance ensures reliable operations.

Key Commands and Their Usage:

Resource monitoring:

free -m            # Display memory usage in MB
vmstat 1           # Virtual memory stats updated every second
Enter fullscreen mode Exit fullscreen mode

Performance analysis:

perf top           # CPU performance analysis
strace command     # Trace system calls
Enter fullscreen mode Exit fullscreen mode


5. Log Management

Logs are essential for debugging and auditing system activities.

Key Commands and Their Usage:

System logs:

journalctl -f                # Follow system logs
journalctl -u service        # View service-specific logs
tail -f /var/log/syslog      # Follow the system log
Enter fullscreen mode Exit fullscreen mode

Log analysis:

grep -r "error" /var/log/    # Search for errors in logs
awk '/pattern/ {print $1,$2}' logfile # Extract specific fields
Enter fullscreen mode Exit fullscreen mode


6. Package Management

Managing software packages efficiently is crucial for system updates and deployments.

Key Commands and Their Usage:

For RHEL/CentOS:

yum update -y             # Update all packages
yum install package       # Install a specific package
Enter fullscreen mode Exit fullscreen mode

For Ubuntu/Debian:

apt update && apt upgrade # Update system
apt install package       # Install a package
Enter fullscreen mode Exit fullscreen mode


7. Security Management

Securing systems involves managing user access, monitoring, and hardening configurations.

Key Commands and Their Usage:

User management:

useradd -m username    # Create a user with a home directory
passwd username        # Set a password for the user
Enter fullscreen mode Exit fullscreen mode

Security monitoring:

last                   # Show last logins
fail2ban-client status # Display banned IPs
Enter fullscreen mode Exit fullscreen mode

Conclusion

Mastering these Linux commands will enhance your efficiency as a DevOps engineer. They are essential for automation, troubleshooting, and maintaining secure, high-performing systems.

Comments 12 total

  • Jessilyneh
    JessilynehJan 19, 2025

    very useful content!

  • Ankit Jain
    Ankit JainJan 19, 2025

    Thanks for the informations! very helpful.

  • juhi sayyed
    juhi sayyedJan 19, 2025

    Thanks you, @megha_shivhare_5038dc1047, for sharing this insightful information. it has been incredibly helpful in my office environment. Could you also create blog on "Log Management" as you mentioned in this post. I would love to explore more command on this topic.

    • Megha Shivhare
      Megha ShivhareJan 19, 2025

      Thanks for the feedback, will bring a more detailed blog on log management soon.

  • tinaaa123tina
    tinaaa123tinaJan 19, 2025

    telegra.ph/sekabet-01-19
    "Sekabet, yüksek oranları ve hızlı kazanç imkanları ile sana en iyi bahis deneyimini sunuyor. Kolayca kazanmak için hemen katıl!"

  • Sherif sani
    Sherif saniJan 19, 2025

    Thanks for sharing 🙏

  • Shiva Shanmugam
    Shiva ShanmugamJan 20, 2025

    Very useful one !

  • My Lovely Friend
    My Lovely FriendJan 21, 2025

    Super helpful

  • Vedansh Dubey
    Vedansh DubeyJan 24, 2025

    Thanks for the great insights... really helpful

Add comment