0% found this document useful (0 votes)
49 views3 pages

Essential Linux Commands for DevOps

The document provides a comprehensive list of commands categorized by their functions, such as System Management, File and Directory Management, Troubleshooting, Networking, Text Processing, Disk Management, User Management, Observability, System Backup, and Security. Each command is accompanied by a brief description of its purpose. This serves as a quick reference guide for users to manage and troubleshoot systems effectively.

Uploaded by

mca10058.24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views3 pages

Essential Linux Commands for DevOps

The document provides a comprehensive list of commands categorized by their functions, such as System Management, File and Directory Management, Troubleshooting, Networking, Text Processing, Disk Management, User Management, Observability, System Backup, and Security. Each command is accompanied by a brief description of its purpose. This serves as a quick reference guide for users to manage and troubleshoot systems effectively.

Uploaded by

mca10058.24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Category Command Description

System Management uptime Shows how long the system has been running.

System Management systemctl start service Manages systemd services (start, stop, restart).

System Management journalctl -xe Displays system logs for debugging.

System Management passwd Changes the current user's password.

System Management adduser username Adds a new user to the system.

System Management sudo command Executes commands with superuser privileges.

System Management neofetch Displays system information visually.

File and Directory Management ls Lists files in the current directory.

File and Directory Management pwd Prints the current working directory.

File and Directory Management cd path Changes the current directory to the specified path.

File and Directory Management mkdir directoryname Creates a new directory.

File and Directory Management touch filename Creates a new file or updates its timestamp.

File and Directory Management cp file destination Copies files and directories.

File and Directory Management mv file destination Moves or renames files and directories.

File and Directory Management rm file Removes files or directories (-r for recursive).

File and Directory Management ln -s file link Creates a symbolic link to a file.

File and Directory Management chmod +x filename Changes file permissions.

File and Directory Management chown user filename Changes file ownership.

File and Directory Management find . -name filename Searches for files in a directory hierarchy.

File and Directory Management cat filename Displays the content of a file.

File and Directory Management less filename Pages through file content.

File and Directory Management head -n 10 filename Displays the first 10 lines of a file.

File and Directory Management tail -n 10 filename Displays the last 10 lines of a file.

Troubleshooting and Performance Monitoring top Displays a real-time view of system processes.

Troubleshooting and Performance Monitoring htop Interactive process viewer (advanced top alternative).

Troubleshooting and Performance Monitoring ps aux Displays information about active processes.

Troubleshooting and Performance Monitoring kill PID Terminates a process by PID.

Troubleshooting and Performance Monitoring killall processname Terminates all processes by name.

Troubleshooting and Performance Monitoring dmesg Displays system kernel messages.

Troubleshooting and Performance Monitoring free -h Displays memory usage in a human-readable format.
Troubleshooting and Performance Monitoring df -h Shows disk space usage.

Troubleshooting and Performance Monitoring du -sh directory Displays disk usage of files or directories.

Troubleshooting and Performance Monitoring vmstat Reports memory, CPU, and IO metrics.

Troubleshooting and Performance Monitoring iostat Displays CPU and IO usage statistics.

Troubleshooting and Performance Monitoring sar Displays historical resource usage.

Networking lsof -i Lists open files or network connections.

Networking ping hostname Tests connectivity to a host.

Networking traceroute hostname Displays the path packets take to reach a host.

Networking curl -O URL Downloads files or performs API requests.

Networking wget URL Downloads files from the internet.

Networking ifconfig Displays network interface configuration (deprecated).

Networking ip addr Shows/manipulates network interfaces and addresses.

Networking netstat -tulpen Displays network connections and routing tables.

Networking ss -tulpen Investigates sockets (modern alternative to netstat).

Networking tcpdump -i eth0 Captures network packets for debugging.

Networking nmap hostname Scans and discovers network hosts.

Networking scp file user@host:path Securely copies files between servers.

Networking rsync -av source dest Synchronizes files and directories.

Text Processing ssh user@host Connects to a remote server via SSH.

Text Processing grep pattern file Searches for patterns in files.

Text Processing awk '/pattern/ {print $1}' file Processes and extracts data from files.

Text Processing sed 's/old/new/' file Performs text transformations.

Text Processing sort filename Sorts the lines of a file.

Text Processing uniq filename Removes duplicate lines from a file.

Text Processing diff file1 file2 Compares two files line by line.

Disk and Storage Management cmp file1 file2 Compares two files byte by byte.

Disk and Storage Management df -h Shows disk space usage.

User Management id Displays user and group IDs of the current or specified user.

User Management whoami Prints the currently logged-in user.

User Management who Shows who is logged into the system.

User Management groups Lists the groups a user belongs to.


User Management usermod -aG groupname username Adds a user to a specific group.

User Management deluser username Removes a user from the system.

User Management passwd -l username Locks a user's password to disable their account.

User Management last Displays the login history of users.

User Management finger username Provides detailed information about a user (if installed).

Observability tload Provides a graphical representation of system load.

Observability watch command Runs a command periodically and shows its output.

Observability iotop Monitors I/O usage by processes.

Observability glances Displays a comprehensive view of system monitoring.

Observability nmon Offers real-time performance monitoring.

Observability atop Monitors system resource usage for long-term analysis.

Observability strace command Traces system calls and signals for a command.

Observability vmstat Reports system performance metrics like memory, CPU, and IO.

Observability iotop Displays disk I/O usage by processes.

System Backup and Recovery tar -czf archive.tar.gz directory Creates a compressed tarball of a directory.

System Backup and Recovery rsync -av source destination Synchronizes files and directories.

System Security ufw enable Configures the firewall.

System Security firewalld Manages firewall rules.

System Security fail2ban-client status Manages Fail2Ban for preventing brute-force attacks.

Networking Specifics ethtool eth0 Displays Ethernet device settings.

Networking Specifics route -n Shows kernel IP routing tables.

Networking Specifics nc -zv host port Checks connectivity to a port.

You might also like