DevOps Engineer Playbook: Practical Commands for Everyday Use
DevOps Engineer Playbook: Practical Commands for Everyday Use Linux Git Docker Kubernetes Helm Terraform Linux is the foundation of DevOps operations – it’s like a Swiss Army knife for servers. These commands help you navigate systems, manage files, configure permissions, and automate tasks in terminal environments. Basic Linux Commands Command Usage pwd Print the current working directory. ls List files and directories. cd Change directory. touch Create an empty file. mkdir Create a new directory. rm Remove files or directories. rmdir Remove empty directories. cp Copy files or directories. mv Move or rename files and directories. cat Display the content of a file. echo Display a line of text. clear Clear the terminal screen. Intermediate Linux Commands Command Usage chmod Change file permissions. chown Change file ownership. find Search for files and directories. grep Search for text in a file. wc Count lines, words, and characters in a file. head Display the first few lines of a file. tail Display the last few lines of a file. sort Sort the contents of a file. uniq Remove duplicate lines from a file. diff Compare two files line by line. tar Archive files into a tarball. zip / unzip Compress and extract ZIP files. df Display disk space usage. du Display directory size. top Monitor system processes in real time. ps Display active processes. kill Terminate a process by its PID. ping Check network connectivity. wget Download files from the internet. curl Transfer data from or to a server. scp Securely copy files between systems. rsync Synchronize files and directories. Advanced Linux Commands Command Usage awk Text processing and pattern scanning. sed Stream editor for filtering and transforming text. cut Remove sections from each line of a file. tr Translate or delete characters. xargs Build and execute command lines from standard input. ln Create symbolic or hard links. df -h Display disk usage in human-readable format. free Display memory usage. iostat Display CPU and I/O statistics. netstat Network statistics (use ss as modern alternative). ifconfig / ip Configure network interfaces (use ip as modern alternative). iptables Configure firewall rules. systemctl Control the systemd system and service manager. journalctl View system logs. crontab Schedule recurring tasks. at Schedule tasks for a specific time. uptime Display system uptime. whoami Display the current user. users List all users currently logged in. hostname Display or set the system hostname. env Display environment variables. export Set environment variables. Networking Commands Command Usage ip addr Display or configure IP addresses. ip route Show or manipulate routing tables. traceroute Trace the route packets take to a host. nslookup Query DNS records. dig Query DNS servers. ssh Connect to a remote server via SSH. ftp Transfer files using the FTP protocol. nmap Network scanning and discovery. telnet Communicate with remote hosts. netcat (nc) Read/write data over networks. File Management and Search Commands Command Usage locate Find files quickly using a database. stat Display detailed information about a file. tree Display directories as a tree. file Determine a file’s type. basename Extract the filename from a path. dirname Extract the directory part of a path. System Monitoring Commands Command Usage vmstat Display virtual memory statistics. htop Interactive process viewer (alternative to top). lsof List open files. dmesg Print kernel ring buffer messages. uptime Show how long the system has been running. iotop Display real-time disk I/O by processes. Package Management Commands Command Usage apt Package manager for Debian-based distributions. yum / dnf Package manager for RHEL-based distributions. snap Manage snap packages. rpm Manage RPM packages. Disk and Filesystem Commands Command Usage mount / umount Mount or unmount filesystems. fsck Check and repair filesystems. mkfs Create a new filesystem. blkid Display information about block devices. lsblk List information about block devices. parted Manage partitions interactively. Scripting and Automation Commands Command Usage bash Command interpreter and scripting shell. sh Legacy shell interpreter. cron Automate tasks. alias Create shortcuts for commands. source Execute commands from a file in the current shell. Development and Debugging Commands Command Usage gcc Compile C programs. make Build and manage projects. strace Trace system calls and signals. gdb Debug programs. git Version control system. vim / nano Text editors for scripting and editing. Other Useful Commands Command Usage uptime Display system uptime. date Display or set the system date and time. cal Display a calendar. man Display the manual for a command. history Show previously executed commands. alias Create custom shortcuts for commands. Git is your code time machine. It tracks every change, enables team collaboration without conflicts, and lets you undo mistakes. These commands help manage source code versions like a professional developer. Basic Git Commands Command Usage Example git init Initializes a new Git repository in the current directory. git init git clone Copies a remote repository to the local machine. git clone https://github.com/user/repo.git git status Displays the state of the working directory and staging area. git status git add Adds changes to the staging area. git add file.txt git commit Records changes to the repository. git commit -m “Initial commit” git config Configures user settings, such as name and email. git config –global user.name “Your Name” git log Shows the commit history. git log git show Displays detailed information about a specific commit. git show <commit-hash> git diff Shows changes between commits, the working directory, and the staging area. git diff git reset Unstages changes or resets commits. git reset HEAD file.txt Branching and Merging Commands Command Usage Example git branch Lists branches or creates a new branch. git branch feature-branch git checkout Switches between branches or restores files. git checkout feature-branch git switch Switches branches (modern alternative to git checkout). git switch feature-branch git merge Combines changes from one branch into another. git merge feature-branch git rebase Moves or combines commits from one branch onto another. git rebase main git cherry-pick Applies specific commits from one branch to another. git cherry-pick <commit-hash> Remote Repositories Commands Command Usage Example git remote Manages remote repository connections. git remote add origin https://github.com/user/repo.git git push Sends changes to




