Skip to main content

Command Palette

Search for a command to run...

Essential Linux Commands(devops)

Published
•5 min read•View as Markdown

Here’s a list of 100 commonly used Linux commands that are frequently encountered in DevOps environments. These commands cover various aspects of system administration, file manipulation, networking, process management, and scripting, all of which are essential in DevOps workflows.

File and Directory Operations:

  1. ls - List files and directories

  2. cd - Change directory

  3. pwd - Print working directory

  4. mkdir - Create directories

  5. rmdir - Remove empty directories

  6. cp - Copy files and directories

  7. mv - Move/rename files and directories

  8. rm - Remove files and directories

  9. touch - Create an empty file or update a file’s timestamp

  10. cat - Concatenate and display file contents

  11. less - View file contents one page at a time

  12. more - Similar to less, but older

  13. head - Show the first few lines of a file

  14. tail - Show the last few lines of a file

  15. find - Search for files and directories

  16. locate - Find files by name using a database

  17. du - Disk usage of files and directories

  18. df - Disk space usage of file systems

  19. tree - Display directory structure in a tree format

  20. ln - Create hard and soft (symbolic) links

File Permissions and Ownership:

  1. chmod - Change file permissions

  2. chown - Change file owner and group

  3. chgrp - Change group ownership of a file

  4. umask - Set default file creation permissions

  5. stat - Display file or filesystem status

Text Processing:

  1. grep - Search text using patterns

  2. sed - Stream editor for filtering and transforming text

  3. awk - Text processing and data extraction language

  4. cut - Remove sections from each line of files

  5. sort - Sort lines of text files

  6. uniq - Report or omit repeated lines

  7. tr - Translate or delete characters

  8. wc - Word, line, character count

  9. diff - Compare the contents of two files

  10. tee - Read from standard input and write to standard output and files

  11. split - Split a file into pieces

  12. paste - Merge lines of files

  13. join - Join lines of two files on a common field

Compression and Archiving:

  1. tar - Archive files

  2. gzip - Compress files using GNU zip

  3. gunzip - Decompress files compressed by gzip

  4. zip - Compress files into an archive

  5. unzip - Extract files from a ZIP archive

  6. xz - Compress files with xz

  7. bzip2 - Compress files with bzip2

  8. 7z - Compress files using 7-zip

Networking:

  1. ping - Test network connectivity

  2. curl - Transfer data from or to a server

  3. wget - Download files from the web

  4. ifconfig - Configure network interfaces (older)

  5. ip - Display or manipulate routing, devices, and tunnels (newer)

  6. netstat - Network statistics (use ss as modern replacement)

  7. ss - Display network socket information

  8. nslookup - Query Internet name servers interactively

  9. dig - DNS lookup utility

  10. traceroute - Trace the route packets take to a network host

  11. scp - Securely copy files between hosts

  12. rsync - Sync files between locations or hosts

  13. ftp - File transfer protocol client

  14. telnet - Simple text-based network protocol client

  15. nmap - Network exploration and security auditing tool

  16. hostname - Show or set the system’s hostname

  17. route - Show or manipulate the IP routing table

  18. ssh - Secure Shell to connect to remote machines

  19. iptables - Firewall configuration tool

  20. netcat (nc) - Network utility for reading from and writing to network connections

Process Management:

  1. ps - Report current process status

  2. top - Display active processes

  3. htop - Interactive process viewer

  4. kill - Terminate a process by PID

  5. pkill - Kill processes by name

  6. nice - Start a process with a given priority

  7. renice - Change the priority of an existing process

  8. jobs - List active jobs

  9. bg - Resume a suspended job in the background

  10. fg - Resume a suspended job in the foreground

  11. nohup - Run a command immune to hangups

  12. screen - Terminal multiplexer

  13. tmux - Terminal multiplexer (more modern than screen)

System Information and Monitoring:

  1. uname - Print system information

  2. uptime - Show how long the system has been running

  3. dmesg - Print or control the kernel ring buffer

  4. free - Show free and used memory

  5. vmstat - Report virtual memory statistics

  6. iostat - CPU and I/O statistics

  7. lsof - List open files

  8. df - Report filesystem disk space usage

  9. sar - Collect, report, or save system activity information

  10. who - Show who is logged on

  11. w - Show who is logged on and what they are doing

Disk and Partition Management:

  1. fdisk - Partition table manipulator

  2. mkfs - Create a filesystem on a device

  3. mount - Mount a filesystem

  4. umount - Unmount a filesystem

  5. fsck - Check and repair a filesystem

  6. blkid - Locate and display block device attributes

  7. df - Show disk space usage

  8. du - Estimate file space usage

  9. lsblk - List information about block devices

  10. parted - Manipulate disk partitions

Bonus DevOps-Specific Tools:

  • docker - Manage Docker containers

  • kubectl - Manage Kubernetes clusters

  • helm - Kubernetes package manager

  • terraform - Infrastructure as code tool for building, changing, and versioning infrastructure

  • ansible - Automation tool for configuration management and deployment

  • git - Version control system to track changes in source code

These are just starting points! DevOps workflows rely heavily on these Linux commands to manage infrastructure, automate processes, and troubleshoot systems.