As a DevOps engineer, proficiency in Linux commands is crucial for managing servers,
automating tasks, and maintaining infrastructure. Here are some of the most useful Linux
commands for a DevOps engineer:
System Monitoring and Management
1. top: Displays real-time system information, including processes, CPU usage, and
memory usage.
2. htop: An interactive process viewer, similar to top, but with a more user-friendly
interface.
3. ps: Lists currently running processes.
4. df: Reports disk space usage.
5. du: Shows disk usage of files and directories.
6. free: Displays memory usage.
7. uptime: Shows how long the system has been running, along with load averages.
8. vmstat: Reports virtual memory statistics.
9. iostat: Reports CPU and I/O statistics.
File and Directory Management
1. ls: Lists files and directories.
2. cd: Changes the current directory.
3. cp: Copies files or directories.
4. mv: Moves or renames files or directories.
5. rm: Removes files or directories.
6. mkdir: Creates directories.
7. rmdir: Removes empty directories.
8. find: Searches for files and directories.
9. grep: Searches text using patterns.
10. tar: Archives files.
11. zip/unzip: Compresses and decompresses files.
Network Management
1. ifconfig/ip: Configures network interfaces.
2. ping: Checks connectivity to another network host.
3. netstat: Displays network connections, routing tables, and interface statistics.
4. traceroute: Traces the route packets take to a network host.
5. curl: Transfers data from or to a server.
6. wget: Downloads files from the web.
7. ss: Displays socket statistics.
8. nslookup/dig: Queries DNS servers.
User and Permission Management
1. adduser/useradd: Adds a new user.
2. deluser/userdel: Deletes a user.
3. passwd: Changes a user's password.
4. chown: Changes file owner and group.
5. chmod: Changes file permissions.
6. chgrp: Changes the group ownership of a file.
Package Management
Debian/Ubuntu:
o apt-get/apt: Installs, updates, and removes packages.
Red Hat/CentOS:
o yum/dnf: Installs, updates, and removes packages.
Log Management
1. tail: Views the end of a file.
2. head: Views the beginning of a file.
3. less: Views file contents one screen at a time.
4. cat: Concatenates and displays file content.
5. grep: Searches for text patterns in files.
6. journalctl: Views systemd logs.
Automation and Scripting
1. crontab: Schedules periodic jobs.
2. at: Schedules a command to run once at a particular time.
3. bash: The Bourne Again SHell, used for scripting.
Version Control
1. git: Version control system to track changes in source code during software
development.
Miscellaneous
1. ssh: Connects to a remote machine securely.
2. scp: Securely copies files between hosts.
3. rsync: Syncs files and directories between two locations.
4. alias: Creates shortcuts for commands.
5. env: Displays or sets environment variables.
6. history: Displays the command history.
These commands are essential for a DevOps engineer to effectively manage and automate
infrastructure, ensure system health, and facilitate smooth deployment and operations.