Essential Linux Commands(devops)
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:
ls- List files and directoriescd- Change directorypwd- Print working directorymkdir- Create directoriesrmdir- Remove empty directoriescp- Copy files and directoriesmv- Move/rename files and directoriesrm- Remove files and directoriestouch- Create an empty file or update a file’s timestampcat- Concatenate and display file contentsless- View file contents one page at a timemore- Similar toless, but olderhead- Show the first few lines of a filetail- Show the last few lines of a filefind- Search for files and directorieslocate- Find files by name using a databasedu- Disk usage of files and directoriesdf- Disk space usage of file systemstree- Display directory structure in a tree formatln- Create hard and soft (symbolic) links
File Permissions and Ownership:
chmod- Change file permissionschown- Change file owner and groupchgrp- Change group ownership of a fileumask- Set default file creation permissionsstat- Display file or filesystem status
Text Processing:
grep- Search text using patternssed- Stream editor for filtering and transforming textawk- Text processing and data extraction languagecut- Remove sections from each line of filessort- Sort lines of text filesuniq- Report or omit repeated linestr- Translate or delete characterswc- Word, line, character countdiff- Compare the contents of two filestee- Read from standard input and write to standard output and filessplit- Split a file into piecespaste- Merge lines of filesjoin- Join lines of two files on a common field
Compression and Archiving:
tar- Archive filesgzip- Compress files using GNU zipgunzip- Decompress files compressed bygzipzip- Compress files into an archiveunzip- Extract files from a ZIP archivexz- Compress files withxzbzip2- Compress files withbzip27z- Compress files using 7-zip
Networking:
ping- Test network connectivitycurl- Transfer data from or to a serverwget- Download files from the webifconfig- Configure network interfaces (older)ip- Display or manipulate routing, devices, and tunnels (newer)netstat- Network statistics (usessas modern replacement)ss- Display network socket informationnslookup- Query Internet name servers interactivelydig- DNS lookup utilitytraceroute- Trace the route packets take to a network hostscp- Securely copy files between hostsrsync- Sync files between locations or hostsftp- File transfer protocol clienttelnet- Simple text-based network protocol clientnmap- Network exploration and security auditing toolhostname- Show or set the system’s hostnameroute- Show or manipulate the IP routing tablessh- Secure Shell to connect to remote machinesiptables- Firewall configuration toolnetcat(nc) - Network utility for reading from and writing to network connections
Process Management:
ps- Report current process statustop- Display active processeshtop- Interactive process viewerkill- Terminate a process by PIDpkill- Kill processes by namenice- Start a process with a given priorityrenice- Change the priority of an existing processjobs- List active jobsbg- Resume a suspended job in the backgroundfg- Resume a suspended job in the foregroundnohup- Run a command immune to hangupsscreen- Terminal multiplexertmux- Terminal multiplexer (more modern thanscreen)
System Information and Monitoring:
uname- Print system informationuptime- Show how long the system has been runningdmesg- Print or control the kernel ring bufferfree- Show free and used memoryvmstat- Report virtual memory statisticsiostat- CPU and I/O statisticslsof- List open filesdf- Report filesystem disk space usagesar- Collect, report, or save system activity informationwho- Show who is logged onw- Show who is logged on and what they are doing
Disk and Partition Management:
fdisk- Partition table manipulatormkfs- Create a filesystem on a devicemount- Mount a filesystemumount- Unmount a filesystemfsck- Check and repair a filesystemblkid- Locate and display block device attributesdf- Show disk space usagedu- Estimate file space usagelsblk- List information about block devicesparted- Manipulate disk partitions
Bonus DevOps-Specific Tools:
docker- Manage Docker containerskubectl- Manage Kubernetes clustershelm- Kubernetes package managerterraform- Infrastructure as code tool for building, changing, and versioning infrastructureansible- Automation tool for configuration management and deploymentgit- 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.