DEV Community

Cover image for 19 Advanced Linux Commands Every Sysadmin Should Know!
DevOps Descent
DevOps Descent

Posted on

19 Advanced Linux Commands Every Sysadmin Should Know!

1. htop

  • Usage: Interactive process viewer that’s much more advanced than top.
  • Command: htop
  • Description: Shows processes, memory, and CPU usage in a user-friendly, color-coded layout.

Image description

2. nmap

  • Usage: Network mapping and discovery.
  • Command: nmap -sP 192.168.1.0/24
  • Description: Scans a network range to identify active devices.

Image description

3. rsync

  • Usage: Syncs directories and files locally or across networked systems.
  • Command: rsync -av /source /destination
  • Description: Great for backups and maintaining directories across systems.

Image description

4. tmux

  • Usage: Terminal multiplexer allowing multiple sessions.
  • Command: tmux
  • Description: Enables you to switch between several programs in a single terminal.

Image description

5. awk

  • Usage: Text processing and data extraction from files.
  • Command: awk '{print $1}' file.txt
  • Description: Powerful for extracting and formatting text data.

Image description

6. dig

  • Usage: DNS lookup tool.
  • Command: dig example.com
  • Description: Provides DNS information for domain troubleshooting.

Image description

7. tcpdump

  • Usage: Packet sniffer for network troubleshooting.
  • Command: sudo tcpdump -i eth0
  • Description: Allows monitoring of incoming and outgoing packets.

Image description

8. lsof

  • Usage: Lists open files and the processes using them.
  • Command: lsof -i :80
  • Description: Essential for diagnosing file locks and network usage.

Image description

9. jq

  • Usage: Processes JSON data.
  • Command: cat file.json | jq '.'
  • Description: Parses and formats JSON data from files or APIs.

Image description

10. iftop

  • Usage: Monitors bandwidth usage per IP.
  • Command: sudo iftop
  • Description: Real-time network traffic monitoring by IP address.

Image description

11. strace

  • Usage: Traces system calls and signals.
  • Command: strace -p <PID>
  • Description: Useful for debugging by tracing system calls from a process.

Image description

12. ip a

  • Usage: Displays network interfaces and IP address configuration.
  • Command: ip a
  • Description: Essential for managing network settings on modern Linux systems.

Image description

13. grep -r

  • Usage: Searches text within files recursively.
  • Command: grep -r 'search-term' /path/to/directory
  • Description: Locates specific text across directories, useful for log analysis.

Image description

14. iostat

  • Usage: Monitors CPU and I/O statistics.
  • Command: iostat -x 1
  • Description: Helps in understanding disk and CPU usage patterns over time.

Image description

15. iptables

  • Usage: Configures firewall rules.
  • Command: sudo iptables -L
  • Description: Manages network traffic control for security purposes.

Image description

16. nc (Netcat)

  • Usage: Network utility for debugging and testing.
  • Command: nc
  • Description: Versatile for creating connections, debugging, and port scanning.

Image description

17. sar

  • Usage: Collects, reports, and saves system activity information.
  • Command: sar -u 1 5
  • Description: Monitors performance metrics, including CPU, memory, and network.

Image description

18. atop

  • Usage: Monitors system performance.
  • Command: atop
  • Description: Provides a detailed look at processes, memory, disk, and network.

Image description

19. watch

  • Usage: Repeats a command at fixed intervals.
  • Command: watch -n 1 df -h
  • Description: Useful for monitoring outputs in real-time, such as disk usage.

Image description

Do check: https://linktr.ee/DevOps_Descent
Youtube: https://shorturl.at/lVi2G

Top comments (1)

Collapse
 
programmerraja profile image
Boopathi

This is a great list! I'm bookmarking this for future reference. It's especially helpful to have the basic usage example included with each command.