{"id":2772,"date":"2025-01-30T12:24:59","date_gmt":"2025-01-30T12:24:59","guid":{"rendered":"https:\/\/w3buddy.com\/?p=2772"},"modified":"2026-01-15T13:20:44","modified_gmt":"2026-01-15T07:50:44","slug":"linux-commands-cheat-sheet-a-quick-reference-guide","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/linux-commands-cheat-sheet-a-quick-reference-guide\/","title":{"rendered":"Linux Commands Cheat Sheet: A Quick Reference Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Mastering Linux starts with knowing the right commands. This Linux Commands Cheat Sheet is your go-to guide, offering quick access to essential commands that can simplify your tasks. From file management to system checks, this cheat sheet ensures you\u2019re always equipped to get things done efficiently. Whether you&#8217;re just starting or looking to boost your command line skills, these key commands will streamline your workflow and save you time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. File and Directory Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># File and Directory Management\n\nls [-a] [-l] [-h] [-t] [-r] [-R] [directory]  \n# List directory contents  \n# -a : show hidden files  \n# -l : long listing format  \n# -h : human-readable sizes  \n# -t : sort by modification time  \n# -r : reverse order  \n# -R : list subdirectories recursively  \n# Example:  \nls -lh \/home\/user  \n\ncd [directory]  \n# Change directory  \n# Example:  \ncd \/var\/www\/html  \n\npwd  \n# Print working directory  \n# Example:  \npwd  \n\ncp [-r] [-i] [-u] [-v] source destination  \n# Copy files and directories  \n# -r : copy directories recursively  \n# -i : prompt before overwrite  \n# -u : copy only when source is newer than destination  \n# -v : verbose output  \n# Example:  \ncp -r \/source\/directory \/destination\/directory  \n\nmv [-i] [-n] [-v] source destination  \n# Move or rename files and directories  \n# -i : prompt before overwrite  \n# -n : do not overwrite an existing file  \n# -v : verbose output  \n# Example:  \nmv -i oldfile.txt newfile.txt  \n\nrm [-r] [-f] [-i] [-v] file  \n# Remove files or directories  \n# -r : remove directories and contents recursively  \n# -f : force remove without confirmation  \n# -i : prompt before every removal  \n# -v : verbose output  \n# Example:  \nrm -rf \/unwanted\/directory  \n\nmkdir [-p] [-v] directory  \n# Make directories  \n# -p : create parent directories if needed  \n# -v : verbose output  \n# Example:  \nmkdir -p \/new\/parent\/directory  \n\nrmdir [-p] directory  \n# Remove empty directories  \n# -p : remove parent directories if empty  \n# Example:  \nrmdir -p \/empty\/parent\/directory  \n\ntouch [-c] [-d time] [-t timestamp] filename  \n# Change file timestamps or create empty files  \n# -c : do not create file if it does not exist  \n# -d time : set modification time  \n# -t timestamp : use a specific timestamp  \n# Example:  \ntouch -t 202401011230 file.txt  \n\nfind [directory] [-name \"filename\"] [-type f\/d] [-size +100M] [-mtime -7] [-exec command {} \\;]  \n# Search for files in a directory hierarchy  \n# -name \"filename\" : search by filename  \n# -type f\/d : search for files (f) or directories (d)  \n# -size +100M : find files larger than 100MB  \n# -mtime -7 : find files modified in the last 7 days  \n# -exec command {} \\; : execute a command on found files  \n# Example:  \nfind \/home -type f -name \"*.log\" -size +50M  \n\nlocate [-i] filename  \n# Find files by name (uses a prebuilt database)  \n# -i : case-insensitive search  \n# Example:  \nlocate -i config.php  \n\ntree [-L level] [-d] [-f] [directory]  \n# Display directories in a tree-like format  \n# -L : limit depth of directory tree  \n# -d : show directories only  \n# -f : show full file path  \n# Example:  \ntree -L 2 -d \/var\/www  \n\nchmod [-R] mode file  \n# Change file permissions  \n# -R : apply changes recursively  \n# Example:  \nchmod -R 755 \/var\/www\/html  \n\nchown [-R] owner:group file  \n# Change file owner and group  \n# -R : apply changes recursively  \n# Example:  \nchown -R user:group \/var\/www\/html  \n\nchgrp [-R] group file  \n# Change group ownership  \n# -R : apply changes recursively  \n# Example:  \nchgrp -R developers \/var\/www\/html  \n\nstat [-c format] file  \n# Display file or file system status  \n# -c : specify custom output format  \n# Example:  \nstat -c \"%U %G %s %y\" file.txt  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. File Viewing and Editing<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># File Viewing and Editing\n\ncat [options] filename  \n# Concatenate and display file content  \n# -n : number all output lines  \n# -E : display `$` at the end of each line  \n# Example:  \ncat -n file.txt  \n\ntac [options] filename  \n# Concatenate and display file content in reverse  \n# Example:  \ntac file.txt  \n\nmore [options] filename  \n# View file content interactively (page by page)  \n# -num : specify number of lines per page  \n# Example:  \nmore -20 file.txt  \n\nless [options] filename  \n# View file content interactively (scrollable)  \n# -N : show line numbers  \n# Example:  \nless -N file.txt  \n\nhead [options] filename  \n# Output the first part of a file  \n# -n num : display the first \u2018num\u2019 lines  \n# Example:  \nhead -n 10 file.txt  \n\ntail [options] filename  \n# Output the last part of a file  \n# -n num : display the last \u2018num\u2019 lines  \n# -f : continuously monitor a file for updates  \n# Example:  \ntail -f \/var\/log\/syslog  \n\nnano filename  \n# Open nano text editor (terminal-based)  \n# Example:  \nnano file.txt  \n\nvim filename  \n# Open Vim text editor  \n# Example:  \nvim file.txt  \n\nvi filename  \n# Open Vi text editor  \n# Example:  \nvi file.txt  \n\nemacs filename  \n# Open Emacs text editor  \n# Example:  \nemacs file.txt  \n\ngrep [options] \"pattern\" filename  \n# Search text using patterns  \n# -i : case-insensitive search  \n# -v : invert match (exclude lines matching pattern)  \n# -r : search recursively in directories  \n# Example:  \ngrep -i \"error\" \/var\/log\/syslog  \n\nsed [options] 'script' filename  \n# Stream editor for filtering and transforming text  \n# -i : edit files in place  \n# -e : add a script to execute  \n# Example:  \nsed -i 's\/oldword\/newword\/g' file.txt  \n\nawk ['pattern {action}'] filename  \n# Pattern scanning and processing language  \n# Example:  \nawk '{print $1, $3}' file.txt  \n\ncut [options] filename  \n# Remove sections from each line of files  \n# -d : specify a delimiter  \n# -f : specify field numbers  \n# Example:  \ncut -d':' -f1 \/etc\/passwd  \n\nsort [options] filename  \n# Sort lines of text files  \n# -r : reverse the sorting order  \n# -n : numeric sort  \n# Example:  \nsort -n file.txt  \n\nuniq [options] filename  \n# Report or omit repeated lines  \n# -c : prefix lines with the number of occurrences  \n# Example:  \nuniq -c file.txt  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Process Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Process Management\n\nps [options]  \n# Report a snapshot of current processes  \n# -e : show all processes  \n# -f : full-format listing  \n# -u user : show processes for a specific user  \n# Example:  \nps -ef  \n\ntop [options]  \n# Display Linux tasks dynamically  \n# -u user : show processes for a specific user  \n# -n num : update display \u2018num\u2019 times before exiting  \n# Example:  \ntop -u root  \n\nhtop  \n# Interactive process viewer (advanced top)  \n# Example:  \nhtop  \n\nkill [options] PID  \n# Send a signal to a process, typically to terminate  \n# -9 : force kill a process  \n# -15 : terminate a process gracefully  \n# Example:  \nkill -9 1234  \n\nkillall [options] process_name  \n# Terminate processes by name  \n# -9 : force kill all processes with the given name  \n# Example:  \nkillall -9 firefox  \n\nbg [job_id]  \n# Resume a suspended job in the background  \n# Example:  \nbg %1  \n\nfg [job_id]  \n# Bring a job to the foreground  \n# Example:  \nfg %1  \n\njobs  \n# List active jobs  \n# Example:  \njobs  \n\nnice [-n adjustment] command  \n# Run a program with modified scheduling priority  \n# Default priority is 0, lower values give higher priority  \n# Example:  \nnice -n 10 myscript.sh  \n\nrenice priority -p PID  \n# Alter priority of running processes  \n# Example:  \nrenice 5 -p 1234  \n\nuptime  \n# Show how long the system has been running  \n# Example:  \nuptime  \n\ntime command  \n# Measure program running time  \n# Example:  \ntime ls -l  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Disk Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Disk Management\n\ndf [options]  \n# Report file system disk space usage  \n# -h : human-readable format  \n# -T : show file system type  \n# -i : display inode usage  \n# Example:  \ndf -h  \n\ndu [options] [directory]  \n# Estimate file space usage  \n# -h : human-readable format  \n# -s : show total size of a directory  \n# -c : display grand total  \n# Example:  \ndu -sh \/var\/log  \n\nfdisk [options] device  \n# Partition table manipulator for Linux  \n# -l : list partition tables  \n# Example:  \nfdisk -l  \n\nlsblk [options]  \n# List information about block devices  \n# -f : show file system type  \n# -o : specify columns to display  \n# Example:  \nlsblk -f  \n\nmount [options] device mount_point  \n# Mount a file system  \n# -t type : specify file system type  \n# -o options : mount with specific options  \n# Example:  \nmount -t ext4 \/dev\/sdb1 \/mnt  \n\numount [options] device\/mount_point  \n# Unmount a file system  \n# -l : lazy unmount  \n# -f : force unmount  \n# Example:  \numount \/mnt  \n\nparted [options] device  \n# A partition manipulation program  \n# -l : list partition details  \n# Example:  \nparted -l  \n\nmkfs [options] -t type device  \n# Create a file system  \n# -t type : specify file system type (ext4, xfs, etc.)  \n# Example:  \nmkfs -t ext4 \/dev\/sdb1  \n\nfsck [options] device  \n# File system consistency check and repair  \n# -y : automatically repair issues  \n# -n : check only, do not repair  \n# Example:  \nfsck -y \/dev\/sdb1  \n\nblkid [options]  \n# Locate\/print block device attributes  \n# Example:  \nblkid \/dev\/sdb1  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. Networking<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Networking\n\nifconfig [interface] [options]  \n# Configure network interfaces (deprecated, use 'ip' instead)  \n# -a : display all interfaces  \n# up : enable interface  \n# down : disable interface  \n# Example:  \nifconfig eth0 up  \n\nip [options] object [command]  \n# Show\/manipulate routing, devices, and tunnels  \n# addr : show IP addresses  \n# route : show routing table  \n# link : show network interfaces  \n# Example:  \nip addr show  \n\nping [options] host  \n# Send ICMP Echo requests to network hosts  \n# -c count : send a specific number of packets  \n# -i interval : set interval between packets  \n# Example:  \nping -c 5 google.com  \n\nnetstat [options]  \n# Display network statistics (deprecated, use 'ss' instead)  \n# -t : show TCP connections  \n# -u : show UDP connections  \n# -a : show all connections  \n# Example:  \nnetstat -tulnp  \n\nss [options]  \n# Show socket statistics (faster alternative to netstat)  \n# -t : show TCP connections  \n# -u : show UDP connections  \n# -l : show listening ports  \n# Example:  \nss -tulnp  \n\ntraceroute [options] host  \n# Trace the route packets take to a network host  \n# -n : show numeric addresses only  \n# -m max_hops : set max number of hops  \n# Example:  \ntraceroute -n google.com  \n\nnslookup [options] domain  \n# Query Internet name servers interactively  \n# Example:  \nnslookup example.com  \n\ndig [options] domain  \n# DNS lookup utility  \n# +short : show concise output  \n# Example:  \ndig google.com  \n\nwget [options] URL  \n# Non-interactive network downloader  \n# -O filename : specify output file  \n# -q : quiet mode  \n# Example:  \nwget -O file.html https:\/\/example.com  \n\ncurl [options] URL  \n# Transfer data with URLs  \n# -o filename : specify output file  \n# -I : fetch headers only  \n# Example:  \ncurl -o file.html https:\/\/example.com  \n\nscp [options] source destination  \n# Secure copy files between hosts  \n# -r : copy directories recursively  \n# Example:  \nscp file.txt user@192.168.1.10:\/home\/user\/  \n\nssh [options] user@host  \n# Secure shell for remote login  \n# -p port : specify port  \n# Example:  \nssh -p 22 user@192.168.1.10  \n\nftp [options] host  \n# File Transfer Protocol client  \n# Example:  \nftp ftp.example.com  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">6. User and Group Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># User and Group Management\n\nuseradd [options] username  \n# Add a user to the system  \n# -m : create the user's home directory  \n# -s shell : specify default shell  \n# Example:  \nuseradd -m -s \/bin\/bash john  \n\nusermod [options] username  \n# Modify a user account  \n# -aG group : add user to a group  \n# -s shell : change the user's shell  \n# Example:  \nusermod -aG sudo john  \n\nuserdel [options] username  \n# Delete a user account  \n# -r : remove the user's home directory and mail spool  \n# Example:  \nuserdel -r john  \n\ngroupadd [options] groupname  \n# Add a group to the system  \n# -g gid : specify group ID  \n# Example:  \ngroupadd developers  \n\ngroupdel groupname  \n# Delete a group  \n# Example:  \ngroupdel developers  \n\npasswd [options] username  \n# Change user password  \n# -e : expire the user's password immediately  \n# Example:  \npasswd john  \n\nchage [options] username  \n# Change user password expiry information  \n# -l : list password expiration info  \n# -M max_days : set max days between password changes  \n# Example:  \nchage -M 30 john  \n\nwhoami  \n# Print the current logged-in user  \n# Example:  \nwhoami  \n\nwho [options]  \n# Show who is logged in  \n# -u : show idle time  \n# Example:  \nwho -u  \n\nw [options]  \n# Show who is logged in and what they\u2019re doing  \n# -h : suppress header  \n# Example:  \nw -h  \n\nid [options] username  \n# Display user and group information  \n# -u : display user ID  \n# -g : display group ID  \n# -G : display all groups the user belongs to  \n# Example:  \nid john  \n\ngroups [username]  \n# Show user\u2019s groups  \n# Example:  \ngroups john  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">7. System Information and Monitoring<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># System Information and Monitoring\n\nuname [options]  \n# Print system information  \n# -a : show all system information  \n# -r : show the kernel release  \n# Example:  \nuname -a  \n\nhostname [options]  \n# Show or set the system\u2019s hostname  \n# -i : show the system's IP address  \n# -f : show the fully qualified domain name  \n# Example:  \nhostname -i  \n\nuptime  \n# How long the system has been running  \n# Example:  \nuptime  \n\ndmesg [options]  \n# Boot and system messages  \n# -T : show human-readable timestamps  \n# -n level : set the level of messages to display  \n# Example:  \ndmesg -T  \n\nfree [options]  \n# Display memory usage  \n# -h : human-readable format  \n# -m : display in megabytes  \n# Example:  \nfree -h  \n\ntop [options]  \n# Display Linux tasks dynamically  \n# -u user : show processes for a specific user  \n# -n num : update display \u2018num\u2019 times before exiting  \n# Example:  \ntop -u root  \n\nvmstat [options]  \n# Report virtual memory statistics  \n# -s : display summary statistics  \n# -a : show active memory  \n# Example:  \nvmstat -s  \n\nlscpu  \n# Display information about the CPU architecture  \n# Example:  \nlscpu  \n\nlsusb  \n# List USB devices  \n# Example:  \nlsusb  \n\nlspci  \n# List PCI devices  \n# Example:  \nlspci  \n\nlshw [options]  \n# List hardware configuration  \n# -short : display in a shorter format  \n# -html : generate HTML output  \n# Example:  \nlshw -short  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">8. Archiving and Compression<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Archiving and Compression\n\ntar [options] [archive] [file(s)]  \n# Archive files  \n# -c : create an archive  \n# -x : extract an archive  \n# -f : specify the archive file  \n# -z : compress with gzip  \n# -j : compress with bzip2  \n# -J : compress with xz  \n# Example:  \ntar -czf archive.tar.gz \/path\/to\/directory  # Compress files using gzip  \ntar -xzf archive.tar.gz  # Extract gzipped tarball  \ntar -cf archive.tar \/path\/to\/directory  # Create a tarball  \ntar -xf archive.tar  # Extract tarball  \n\nzip [options] archive.zip [file(s)]  \n# Package and compress files into a ZIP archive  \n# -r : recursively zip directories  \n# -9 : set the compression level (1-9, where 9 is the highest)  \n# Example:  \nzip -r archive.zip \/path\/to\/directory  \n\nunzip [options] archive.zip  \n# Extract files from a ZIP archive  \n# -d directory : extract to a specific directory  \n# Example:  \nunzip archive.zip -d \/path\/to\/extract  \n\ngzip [options] file  \n# Compress files using the gzip algorithm  \n# -d : decompress the file  \n# -k : keep the original file after compression  \n# Example:  \ngzip file.txt  # Compress file  \ngzip -d file.txt.gz  # Decompress file  \n\ngunzip [options] file.gz  \n# Decompress files compressed with gzip  \n# Example:  \ngunzip file.txt.gz  \n\nbzip2 [options] file  \n# Compress files using the bzip2 algorithm  \n# -d : decompress the file  \n# -k : keep the original file after compression  \n# Example:  \nbzip2 file.txt  # Compress file  \nbzip2 -d file.txt.bz2  # Decompress file  \n\nbunzip2 [options] file.bz2  \n# Decompress files compressed with bzip2  \n# Example:  \nbunzip2 file.txt.bz2  \n\nxz [options] file  \n# Compress files using the xz algorithm  \n# -d : decompress the file  \n# -k : keep the original file after compression  \n# Example:  \nxz file.txt  # Compress file  \nxz -d file.txt.xz  # Decompress file  \n\nunxz [options] file.xz  \n# Decompress files compressed with xz  \n# Example:  \nunxz file.txt.xz  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">9. Package Management (Depends on Distribution)<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Package Management (Depends on Distribution)\n\n# Debian-based (e.g., Ubuntu)\n\napt-get [options] command  \n# APT package handling utility  \n# install : install a package  \n# update : update package list  \n# upgrade : upgrade installed packages  \n# remove : remove a package  \n# Example:  \napt-get install vim  # Install a package  \napt-get update  # Update package list  \napt-get upgrade  # Upgrade installed packages  \napt-get remove vim  # Remove a package  \n\napt-cache [options] command  \n# Query APT cache  \n# search : search for a package  \n# show : show package details  \n# Example:  \napt-cache search vim  # Search for a package  \napt-cache show vim  # Show package details  \n\n# Red Hat-based (e.g., CentOS, Fedora)\n\nyum [options] command  \n# Package manager for RPM-based systems  \n# install : install a package  \n# update : update installed packages  \n# remove : remove a package  \n# Example:  \nyum install vim  # Install a package  \nyum update  # Update installed packages  \nyum remove vim  # Remove a package  \n\ndnf [options] command  \n# Next-generation package manager (Fedora, CentOS 8+)  \n# install : install a package  \n# update : update installed packages  \n# remove : remove a package  \n# Example:  \ndnf install vim  # Install a package  \ndnf update  # Update installed packages  \ndnf remove vim  # Remove a package  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">10. General Commands<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># General Commands\n\nrpm [options] &lt;package>  \n# RPM package manager  \n# -i : install an RPM package  \n# -e : remove an RPM package  \n# Example:  \nrpm -i package.rpm  # Install an RPM package  \nrpm -e package  # Remove an RPM package  \n\ndpkg [options] &lt;package>  \n# Debian package manager  \n# -i : install a Debian package  \n# -r : remove a Debian package  \n# Example:  \ndpkg -i package.deb  # Install a Debian package  \ndpkg -r package  # Remove a Debian package  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">11. System Services and Daemon Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># System Services and Daemon Management\n\nsystemctl [options] &lt;service>  \n# Control the systemd system and service manager  \n# start : start a service  \n# stop : stop a service  \n# restart : restart a service  \n# enable : enable a service to start on boot  \n# disable : disable a service from starting on boot  \n# status : check service status  \n# Example:  \nsystemctl start apache2  # Start a service  \nsystemctl stop apache2  # Stop a service  \nsystemctl restart apache2  # Restart a service  \nsystemctl enable apache2  # Enable a service to start on boot  \nsystemctl disable apache2  # Disable a service from starting on boot  \nsystemctl status apache2  # Check service status  \n\nservice [options] &lt;service>  \n# Older service management command (used in non-systemd systems)  \n# start : start a service  \n# stop : stop a service  \n# restart : restart a service  \n# status : check service status  \n# Example:  \nservice apache2 start  # Start a service  \nservice apache2 stop  # Stop a service  \nservice apache2 restart  # Restart a service  \nservice apache2 status  # Check service status  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">12. Scheduling Tasks<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Scheduling Tasks\n\ncron  \n# Daemon for running scheduled commands  \n# Example:  \n# Edit, list, or remove cron jobs using the crontab command (listed below).  \n\ncrontab [options]  \n# Manage cron jobs for the current user  \n# -e : edit cron jobs  \n# -l : list the current user\u2019s cron jobs  \n# -r : remove the current user's cron jobs  \n# Example:  \ncrontab -e  # Edit cron jobs for the current user  \ncrontab -l  # List the current user\u2019s cron jobs  \ncrontab -r  # Remove the current user's cron jobs  \n\nat [time]  \n# Run commands at a specified time  \n# Example:  \nat 09:00  # Schedule a command to run at 09:00 AM  \n\nbatch  \n# Run commands when the system load is low  \n# Example:  \nbatch  # Run commands when the system load is low  \n\nsleep [time]  \n# Delay for a specified time  \n# Example:  \nsleep 5s  # Sleep for 5 seconds  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">13. File Permissions and Security<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># File Permissions and Security\n\nchmod [options] &lt;file>  \n# Change file permissions  \n# -r : recursively change permissions for directories and their contents  \n# Example:  \nchmod 755 file.txt  # Change file permissions to rwx-r-xr-x  \nchmod -r 755 \/path\/to\/directory  # Change permissions recursively  \n\nchown [options] &lt;user>:&lt;group> &lt;file>  \n# Change file owner and group  \n# -R : recursively change ownership for directories and their contents  \n# Example:  \nchown user:group file.txt  # Change file owner and group  \nchown -R user:group \/path\/to\/directory  # Change ownership recursively  \n\nchgrp [options] &lt;group> &lt;file>  \n# Change the group ownership of a file  \n# -R : recursively change group ownership for directories and their contents  \n# Example:  \nchgrp group file.txt  # Change group ownership of a file  \nchgrp -R group \/path\/to\/directory  # Change group ownership recursively  \n\numask [mode]  \n# Set default permissions for new files  \n# Example:  \numask 022  # Set default permissions for new files  \n\nsetfacl [options] &lt;file>  \n# Set file access control lists (ACL)  \n# -m : modify ACL  \n# -x : remove an ACL  \n# Example:  \nsetfacl -m u:username:rw file.txt  # Set ACL to allow a user read\/write access  \n\ngetfacl [options] &lt;file>  \n# Get file access control lists (ACL)  \n# Example:  \ngetfacl file.txt  # Get the ACL of a file  \n\nsudo [command]  \n# Execute a command as another user (usually root)  \n# Example:  \nsudo apt-get update  # Execute command as root  \n\nvisudo  \n# Edit the sudoers file safely  \n# Example:  \nvisudo  # Edit the sudoers file safely  \n\npasswd [options] &lt;user>  \n# Change a user\u2019s password  \n# Example:  \npasswd  # Change the password of the current user  \npasswd username  # Change the password for a specific user  \n\nsudoers  \n# Manage sudo access for users  \n# Example:  \n# This is typically edited using visudo (listed above).  \n\ngpasswd [options] &lt;group>  \n# Administer group password  \n# Example:  \ngpasswd groupname  # Administer password for a group  \n\nss [options]  \n# Display socket statistics (for secure network connections)  \n# -t : show TCP sockets  \n# -u : show UDP sockets  \n# Example:  \nss -tuln  # Show listening sockets for TCP and UDP  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">14. System Backup and Restore<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># System Backup and Restore\n\nrsync [options] &lt;source> &lt;destination>  \n# Remote file and directory synchronization  \n# -a : archive mode (preserve symbolic links, permissions, timestamps, etc.)  \n# -v : verbose  \n# -z : compress file data during transfer  \n# Example:  \nrsync -avz source\/ destination\/  # Synchronize files  \nrsync -avz -e ssh source\/ user@remote:\/destination\/  # Sync over SSH  \n\ncpio [options]  \n# Copy files to and from archives  \n# Example:  \n# cpio is typically used in conjunction with other commands like find for backup and restore  \nfind \/path\/to\/files | cpio -ov > backup.cpio  # Create a backup archive  \ncpio -iv &lt; backup.cpio  # Extract files from the archive  \n\ndd [options]  \n# Low-level copying and backup of entire filesystems  \n# if : input file or device  \n# of : output file or device  \n# Example:  \ndd if=\/dev\/sda of=\/path\/to\/backup.img  # Backup a disk\/partition  \ndd if=\/path\/to\/backup.img of=\/dev\/sda  # Restore a disk\/partition  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">15. System Diagnostics and Troubleshooting<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># System Diagnostics and Troubleshooting\n\ndmesg [options]  \n# Print the kernel ring buffer messages (system boot and hardware-related messages)  \n# Example:  \ndmesg  # View kernel ring buffer messages  \n\njournalctl [options]  \n# Query and view logs from systemd\u2019s journal  \n# Example:  \njournalctl  # View all systemd logs  \njournalctl -u apache2  # View logs for a specific service  \n\nstrace [options] &lt;command>  \n# Trace system calls and signals  \n# Example:  \nstrace ls  # Trace the system calls of the ls command  \n\nlsof [options]  \n# List open files (useful for debugging)  \n# Example:  \nlsof  # List all open files  \nlsof \/path\/to\/file  # Show processes using a specific file  \n\nvmstat [options]  \n# Report virtual memory statistics  \n# Example:  \nvmstat 1  # Report every second  \n\niostat [options]  \n# Report CPU and I\/O statistics  \n# Example:  \niostat  # Report CPU and I\/O statistics  \n\nmpstat [options]  \n# Report CPU usage statistics  \n# Example:  \nmpstat 1  # Report CPU usage every second  \n\npidstat [options]  \n# Report statistics by process  \n# Example:  \npidstat 1  # Report process statistics every second  \n\nfree [options]  \n# Display memory usage  \n# Example:  \nfree -h  # Display memory usage in human-readable format  \n\nuptime  \n# How long the system has been running  \n# Example:  \nuptime  # Show system uptime  \n\nwatch [options] &lt;command>  \n# Execute a program periodically, showing output  \n# -n : interval in seconds  \n# Example:  \nwatch -n 1 free  # Watch memory usage every second  \n\nlshw [options]  \n# List hardware configuration  \n# Example:  \nlshw  # List detailed hardware configuration  \n\nhtop  \n# Interactive process viewer (better than top)  \n# Example:  \nhtop  # Launch the interactive process viewer  \n\nnetstat [options]  \n# Network statistics (deprecated in favor of ss)  \n# Example:  \nnetstat  # Show network statistics  \n\nss [options]  \n# Show socket statistics (more efficient than netstat)  \n# Example:  \nss -tuln  # Show listening TCP\/UDP sockets  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">16. Networking &amp; Remote Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Networking &amp; Remote Management\n\nifconfig [options]  \n# Configure network interfaces (older command, replaced by ip)  \n# Example:  \nifconfig  # View or configure network interfaces  \n\nip [options]  \n# A more modern alternative for managing network interfaces and routing  \n# ip addr : Show IP addresses  \n# ip link : Show or manipulate network interfaces  \n# ip route : Show or manipulate routing tables  \n# Example:  \nip addr  # Show IP addresses  \nip link  # Show or manipulate network interfaces  \nip route  # Show or manipulate routing tables  \n\nss [options]  \n# Display socket statistics (useful for diagnosing network issues)  \n# Example:  \nss -tuln  # Show listening TCP\/UDP sockets  \n\nnmap [options]  \n# Network exploration tool (can be used for security auditing)  \n# Example:  \nnmap -sP 192.168.1.0\/24  # Scan a network range  \n\ntelnet [options]  \n# User interface to the TELNET protocol (less common nowadays)  \n# Example:  \ntelnet &lt;host>  # Connect to a remote host via TELNET  \n\nnc (Netcat) [options]  \n# Network utility for reading and writing from network connections  \n# -l : listen mode  \n# -p : port  \n# Example:  \nnc -l -p 1234  # Listen on port 1234  \nnc &lt;host> &lt;port>  # Connect to a host and port  \n\niptables [options]  \n# Administration tool for IPv4 packet filtering and NAT (Network Address Translation)  \n# Example:  \niptables -L  # List current iptables rules  \n\nfirewalld [options]  \n# Frontend for managing firewall rules (used in some distros like Fedora and CentOS)  \n# Example:  \nfirewalld --zone=public --add-port=80\/tcp  # Allow HTTP traffic  \n\nufw [options]  \n# Uncomplicated firewall (front-end for iptables)  \n# -enable : enable firewall  \n# -allow &lt;port> : allow traffic on a specific port  \n# Example:  \nufw enable  # Enable firewall  \nufw allow 80  # Allow HTTP traffic  \n\ntcpdump [options]  \n# Command-line packet analyzer  \n# Example:  \ntcpdump -i eth0  # Capture packets on interface eth0  \n\ncurl [options]  \n# Transfer data from or to a server using various protocols (HTTP, FTP, etc.)  \n# Example:  \ncurl -O http:\/\/example.com\/file.txt  # Download a file  \n\nwget [options]  \n# Download files from the web via HTTP, HTTPS, FTP  \n# Example:  \nwget http:\/\/example.com\/file.txt  # Download a file  \n\nscp [options]  \n# Secure copy over SSH (used to copy files between systems)  \n# Example:  \nscp file.txt user@remote:\/path\/to\/destination\/  # Copy file to remote server  \n\nrsync [options]  \n# Remote file and directory synchronization (often used for backups)  \n# Example:  \nrsync -avz \/local\/path\/ remote:\/remote\/path\/  # Sync directories  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">17. Text Processing Utilities<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Text Processing Utilities\n\ngrep [options] 'pattern' [file]  \n# Search for patterns within files  \n# -r : recursively search in directories  \n# Example:  \ngrep 'pattern' file.txt  # Search for a pattern in a file  \ngrep -r 'pattern' \/dir\/  # Recursively search for a pattern  \n\nsed [options]  \n# Stream editor for filtering and transforming text  \n# s\/old\/new\/g : replace 'old' with 'new' globally  \n# Example:  \nsed 's\/old\/new\/g' file.txt  # Replace old with new globally  \n\nawk [options]  \n# A powerful text processing language  \n# {print $1} : print the first column of each line in a file  \n# Example:  \nawk '{print $1}' file.txt  # Print the first column of each line in a file  \n\ncut [options]  \n# Remove sections from each line of a file  \n# -d : delimiter  \n# -f : field(s) to extract  \n# Example:  \ncut -d ':' -f 1 \/etc\/passwd  # Print the first field of each line, delimited by \":\"  \n\nsort [options]  \n# Sort lines of text files  \n# Example:  \nsort file.txt  # Sort file content in ascending order  \n\nuniq [options]  \n# Report or omit repeated lines in a file  \n# Example:  \nsort file.txt | uniq  # Sort and remove duplicate lines  \n\ntee [options]  \n# Read from standard input and write to standard output and files  \n# Example:  \necho \"text\" | tee file.txt  # Write to file and show output on screen  \n\ntr [options]  \n# Translate or delete characters  \n# Example:  \necho \"hello\" | tr 'a-z' 'A-Z'  # Convert lowercase to uppercase  \n\npaste [options]  \n# Merge lines of files  \n# Example:  \npaste file1.txt file2.txt  # Combine lines of file1 and file2 side by side  \n\nwc [options]  \n# Word, line, character, and byte count  \n# -l : count lines  \n# -w : count words  \n# Example:  \nwc -l file.txt  # Count lines in a file  \nwc -w file.txt  # Count words in a file  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">18. System Shutdown and Reboot<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\"># System Shutdown and Reboot\n\nshutdown [options]  \n# Shut down the system  \n# -h : halt the system  \n# -r : reboot the system  \n# +&lt;time> : shut down after specified minutes  \n# Example:  \nshutdown -h now  # Immediately shut down  \nshutdown -r now  # Reboot the system  \nshutdown -h +10  # Shut down after 10 minutes  \n\nreboot  \n# Reboot the system  \n# Example:  \nreboot  # Reboot the system  \n\nhalt  \n# Halt the system immediately (equivalent to turning off power)  \n# Example:  \nhalt  # Stop all system processes  \n\npoweroff  \n# Power off the system  \n# Example:  \npoweroff  # Turn off the system  \n\ninit [runlevel]  \n# Change the runlevel (old-style system manager)  \n# 0 : shutdown  \n# 6 : reboot  \n# Example:  \ninit 0  # Shutdown  \ninit 6  # Reboot<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">19. File System Mounting and Management<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># File System Mounting and Management\n\nmount [options] [device] [mount-point]  \n# Mount a file system  \n# Example:  \nmount \/dev\/sda1 \/mnt  # Mount partition to a directory  \n\numount [options] [mount-point]  \n# Unmount a file system  \n# Example:  \numount \/mnt  # Unmount the file system mounted at \/mnt  \n\nfstab  \n# File system table (configuration file for mounting file systems)  \n# \/etc\/fstab : View and configure persistent mount points  \n# Example:  \ncat \/etc\/fstab  # View fstab configuration  \n\nblkid  \n# Display block device attributes  \n# Example:  \nblkid  # Show attributes of all block devices  \n\nfsck [options] [device]  \n# Check and repair a file system  \n# Example:  \nfsck \/dev\/sda1  # Check and repair \/dev\/sda1  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">20. Filesystem Permissions and Security<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Filesystem Permissions and Security\n\nchmod [options] [permissions] [file]  \n# Change file permissions  \n# Example:  \nchmod 755 file.txt  # Give read, write, and execute permissions to owner, and read-execute permissions to others  \n\nchown [options] [owner][:group] [file]  \n# Change file owner and group  \n# Example:  \nchown user:group file.txt  # Change owner and group of a file  \n\nchgrp [options] [group] [file]  \n# Change group ownership of a file  \n# Example:  \nchgrp group file.txt  # Change the group of a file  \n\numask [permissions]  \n# Set default permissions for new files  \n# Example:  \numask 022  # Set default permissions for newly created files to 755  \n\nsetfacl [options] [file]  \n# Set access control lists (ACL) for file permissions  \n# Example:  \nsetfacl -m u:user:rwx file.txt  # Set ACL to give 'user' read, write, execute permissions  \n\ngetfacl [file]  \n# Get access control lists (ACL) for file permissions  \n# Example:  \ngetfacl file.txt  # View ACL for a file  <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">21. Containerization and Orchestration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Docker<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">docker [options] [command]  \n# Docker command-line interface (CLI) for managing containers\n\ndocker run [options] &lt;image>  \n# Run a container from an image  \n# Example:  \ndocker run ubuntu  # Run a container from the Ubuntu image  \n\ndocker ps [options]  \n# List running containers  \n# Example:  \ndocker ps  # List all running containers  \n\ndocker ps -a [options]  \n# List all containers, including stopped ones  \n# Example:  \ndocker ps -a  # List all containers  \n\ndocker build -t &lt;image_name> .  \n# Build an image from a Dockerfile  \n# Example:  \ndocker build -t my-image .  # Build an image named 'my-image' from the Dockerfile in the current directory  \n\ndocker exec -it &lt;container_id> bash  \n# Start an interactive bash shell inside a running container  \n# Example:  \ndocker exec -it container_id bash  # Access bash shell in a running container  \n\ndocker stop &lt;container_id>  \n# Stop a container  \n# Example:  \ndocker stop container_id  # Stop the container with the specified ID  \n\ndocker rm &lt;container_id>  \n# Remove a container  \n# Example:  \ndocker rm container_id  # Remove the specified container  \n\ndocker logs &lt;container_id>  \n# View logs of a container  \n# Example:  \ndocker logs container_id  # View logs from the container  \n\ndocker images [options]  \n# List available images  \n# Example:  \ndocker images  # List all Docker images  \n\ndocker rmi &lt;image_name>  \n# Remove an image  \n# Example:  \ndocker rmi my-image  # Remove the 'my-image' image  \n\ndocker network ls  \n# List Docker networks  \n# Example:  \ndocker network ls  # List all Docker networks  \n\ndocker-compose [options]  \n# Manage multi-container Docker applications\n\ndocker-compose up [options]  \n# Start up a multi-container environment  \n# Example:  \ndocker-compose up  # Start up the environment defined in the docker-compose.yml file  \n\ndocker-compose down [options]  \n# Stop and remove containers created by docker-compose  \n# Example:  \ndocker-compose down  # Stop and remove the containers  \n\ndocker-compose logs [options]  \n# View logs from containers managed by docker-compose  \n# Example:  \ndocker-compose logs  # View logs from containers in the docker-compose environment  <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Kubernetes (k8s)<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Kubernetes (k8s)\n\nkubectl [options] [command]  \n# Command-line tool for interacting with Kubernetes clusters\n\nkubectl get pods [options]  \n# List pods in the current namespace  \n# Example:  \nkubectl get pods  # List all pods in the current namespace\n\nkubectl get nodes [options]  \n# List nodes in the cluster  \n# Example:  \nkubectl get nodes  # List all nodes in the cluster\n\nkubectl get services [options]  \n# List services in the cluster  \n# Example:  \nkubectl get services  # List all services in the cluster\n\nkubectl apply -f &lt;file>.yaml [options]  \n# Apply configuration from a file (e.g., a deployment or pod configuration)  \n# Example:  \nkubectl apply -f deployment.yaml  # Apply configuration from the deployment.yaml file\n\nkubectl create -f &lt;file>.yaml [options]  \n# Create a resource from a file  \n# Example:  \nkubectl create -f pod.yaml  # Create a pod from the pod.yaml file\n\nkubectl delete -f &lt;file>.yaml [options]  \n# Delete a resource defined in a file  \n# Example:  \nkubectl delete -f service.yaml  # Delete the service defined in service.yaml\n\nkubectl exec -it &lt;pod_name> -- bash  \n# Execute a command inside a pod (e.g., open a shell)  \n# Example:  \nkubectl exec -it my-pod -- bash  # Open a bash shell inside the 'my-pod' pod\n\nkubectl logs &lt;pod_name>  \n# View the logs of a pod  \n# Example:  \nkubectl logs my-pod  # View logs of the 'my-pod' pod\n\nkubectl describe pod &lt;pod_name>  \n# Get detailed information about a pod  \n# Example:  \nkubectl describe pod my-pod  # Get detailed information about the 'my-pod' pod\n\nkubectl scale deployment &lt;deployment_name> --replicas=&lt;number>  \n# Scale a deployment to the desired number of replicas  \n# Example:  \nkubectl scale deployment my-deployment --replicas=3  # Scale 'my-deployment' to 3 replicas\n\nkubectl rollout restart deployment &lt;deployment_name>  \n# Restart a deployment  \n# Example:  \nkubectl rollout restart deployment my-deployment  # Restart the 'my-deployment' deployment\n\nkubectl port-forward pod &lt;pod_name> &lt;local_port>:&lt;remote_port>  \n# Forward a port from a pod to localhost  \n# Example:  \nkubectl port-forward pod my-pod 8080:80  # Forward port 80 from 'my-pod' to local port 8080<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Helm &#8211; Kubernetes package manager for deploying applications<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Helm - Kubernetes package manager for deploying applications\n\nhelm [options] [command]  \n# Helm CLI for managing Kubernetes applications\n\nhelm install &lt;release_name> &lt;chart_name> [options]  \n# Install a Helm chart  \n# Example:  \nhelm install my-release stable\/mysql  # Install the 'mysql' chart with the release name 'my-release'\n\nhelm upgrade &lt;release_name> &lt;chart_name> [options]  \n# Upgrade a Helm release  \n# Example:  \nhelm upgrade my-release stable\/mysql  # Upgrade the 'my-release' release to the latest 'mysql' chart version\n\nhelm list [options]  \n# List all Helm releases  \n# Example:  \nhelm list  # List all the installed Helm releases\n\nhelm delete &lt;release_name> [options]  \n# Delete a Helm release  \n# Example:  \nhelm delete my-release  # Delete the 'my-release' Helm release\n\nhelm search &lt;chart_name> [options]  \n# Search for a Helm chart  \n# Example:  \nhelm search mysql  # Search for Helm charts related to 'mysql'<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Ansible<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">ansible [options] [command]  \n# Ansible CLI for automation and configuration management\n\nansible all -m ping  \n# Ping all hosts defined in the inventory  \n# Example:  \nansible all -m ping  # Test connectivity to all hosts\n\nansible-playbook playbook.yml  \n# Run an Ansible playbook  \n# Example:  \nansible-playbook deploy_app.yml  # Execute the specified playbook\n\nansible -m command -a 'command' &lt;host>  \n# Run a single command on a target host  \n# Example:  \nansible -m command -a 'uptime' server01  # Run 'uptime' on 'server01'\n\nansible-playbook --check playbook.yml  \n# Dry-run a playbook to see what would change  \n# Example:  \nansible-playbook --check deploy_app.yml  # Preview changes without actually applying\n\nansible-playbook --limit &lt;host> playbook.yml  \n# Run a playbook on a specific host or group  \n# Example:  \nansible-playbook --limit server01 deploy_app.yml  # Run the playbook only on 'server01'\n\nansible-playbook --extra-vars \"key=value\"  \n# Pass extra variables to a playbook  \n# Example:  \nansible-playbook -e \"env=production\" deploy_app.yml  # Pass 'env=production' to the playbook<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Terraform<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">terraform [options] [command]  \n# Terraform CLI for infrastructure as code\n\nterraform init  \n# Initialize a working directory for Terraform configuration  \n# Example:  \nterraform init  # Initialize the directory containing Terraform configuration files\n\nterraform plan  \n# Show an execution plan (preview of what changes will be made)  \n# Example:  \nterraform plan  # Preview the changes that will be made to infrastructure\n\nterraform apply  \n# Apply the changes described in a Terraform configuration  \n# Example:  \nterraform apply  # Apply the planned changes to infrastructure\n\nterraform destroy  \n# Destroy infrastructure created by Terraform  \n# Example:  \nterraform destroy  # Destroy all infrastructure managed by Terraform\n\nterraform validate  \n# Validate the configuration files  \n# Example:  \nterraform validate  # Check for any syntax or logical errors in Terraform files\n\nterraform show  \n# Show the current state of the infrastructure  \n# Example:  \nterraform show  # Display the current infrastructure state<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Puppet<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">puppet [options] [command]  \n# Puppet CLI for configuration management\n\npuppet apply &lt;manifest.pp>  \n# Apply a Puppet manifest locally  \n# Example:  \npuppet apply site.pp  # Apply the local Puppet manifest 'site.pp'\n\npuppet agent --test  \n# Test the Puppet agent (can be used to run a one-off run)  \n# Example:  \npuppet agent --test  # Run a one-time agent run for configuration management\n\npuppet resource  \n# Show the current state of resources (files, services, etc.)  \n# Example:  \npuppet resource service apache  # Show the current state of the Apache service<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">22. CI \/ CD Tool and Commands<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Jenkins <\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">java -jar jenkins.war  \n# Start Jenkins from a WAR file  \n# Example:  \njava -jar jenkins.war  # Launch Jenkins server from the 'jenkins.war' file\n\n# Access Jenkins through http:\/\/localhost:8080 by default<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">GitLab CI<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">.gitlab-ci.yml  \n# Configuration file for GitLab CI\/CD pipelines (typically resides in your repository)  \n# Example:  \n# .gitlab-ci.yml file defines the pipeline stages and jobs\n\ngitlab-runner register  \n# Register a new runner with GitLab  \n# Example:  \ngitlab-runner register --url https:\/\/gitlab.com\/ --registration-token &lt;token>  # Register a runner\n\ngitlab-runner run  \n# Run the GitLab Runner to process jobs  \n# Example:  \ngitlab-runner run  # Run the registered runner to execute jobs<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">GitHub Actions<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># GitHub Actions uses YAML configuration files (typically located in .github\/workflows\/)\n# Example of GitHub Action YAML file:\n\nname: CI Pipeline  \non:  \n  push:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions\/checkout@v2  # Checkout the repository code in your CI pipeline\n      \n      - name: Setup Node.js  \n        uses: actions\/setup-node@v2  # Setup Node.js for use in a pipeline\n      \n      - name: Set up Docker Buildx  \n        uses: docker\/setup-buildx-action@v1  # Set up Docker Buildx for building multi-platform images<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">23. Cloud Services<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">AWS CLI<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">aws [service] [operation] [options]  \n# Command-line tool for managing AWS services\n\naws configure  \n# Configure AWS CLI with your credentials  \n# Example:  \naws configure  # Set up AWS access credentials (Access Key, Secret Key, region)\n\naws s3 cp file.txt s3:\/\/bucket-name\/  \n# Copy a file to an S3 bucket  \n# Example:  \naws s3 cp file.txt s3:\/\/my-bucket\/  # Upload 'file.txt' to S3 bucket\n\naws ec2 describe-instances  \n# Describe EC2 instances  \n# Example:  \naws ec2 describe-instances  # Get details of EC2 instances\n\naws ec2 start-instances --instance-ids &lt;id>  \n# Start an EC2 instance  \n# Example:  \naws ec2 start-instances --instance-ids i-0123456789abcde  # Start an EC2 instance with the given ID\n\naws ec2 stop-instances --instance-ids &lt;id>  \n# Stop an EC2 instance  \n# Example:  \naws ec2 stop-instances --instance-ids i-0123456789abcde  # Stop an EC2 instance with the given ID\n\naws s3 sync  \n# Sync directories with an S3 bucket  \n# Example:  \naws s3 sync \/local\/directory\/ s3:\/\/my-bucket\/  # Sync local directory to S3 bucket<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Azure CLI<\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">az [service] [operation] [options]  \n# Command-line tool for managing Azure services\n\naz login  \n# Log in to your Azure account  \n# Example:  \naz login  # Log in to Azure\n\naz vm list  \n# List all virtual machines  \n# Example:  \naz vm list  # Get a list of all VMs in Azure\n\naz vm start --name &lt;vm_name> --resource-group &lt;resource_group>  \n# Start an Azure VM  \n# Example:  \naz vm start --name myVM --resource-group myResourceGroup  # Start a VM named 'myVM'\n\naz storage blob upload  \n# Upload files to an Azure blob storage  \n# Example:  \naz storage blob upload --container-name mycontainer --file file.txt --name file.txt  # Upload file to Azure blob storage\n\naz group create  \n# Create a new resource group in Azure  \n# Example:  \naz group create --name myResourceGroup --location eastus  # Create a new resource group<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Google Cloud SDK (gcloud)<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">gcloud [service] [operation] [options]  \n# Command-line tool for Google Cloud Platform\n\ngcloud auth login  \n# Log in to Google Cloud  \n# Example:  \ngcloud auth login  # Log in to your Google Cloud account\n\ngcloud compute instances list  \n# List compute instances  \n# Example:  \ngcloud compute instances list  # Get a list of VM instances in Google Cloud\n\ngcloud compute instances stop &lt;instance_name>  \n# Stop a Google Cloud VM instance  \n# Example:  \ngcloud compute instances stop my-instance  # Stop the VM 'my-instance'\n\ngcloud app browse  \n# Open the current Google App Engine application in a browser  \n# Example:  \ngcloud app browse  # Open the app hosted in Google Cloud<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">24. Logging and Monitoring<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Prometheus (System Monitoring and Alerting Toolkit)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">prometheus  \n# Start Prometheus server (usually runs as a service in the background)  \n# Example:  \nprometheus  # Starts Prometheus monitoring system\n\nprometheus --config.file=&lt;config_file>  \n# Start Prometheus with a specific config file  \n# Example:  \nprometheus --config.file=\/etc\/prometheus\/prometheus.yml  # Run Prometheus with custom configuration file<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Grafana (Open-Source Data Visualization)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">grafana-cli  \n# Command-line interface for managing Grafana plugins\n\ngrafana-cli plugins install &lt;plugin-name>  \n# Install a plugin in Grafana  \n# Example:  \ngrafana-cli plugins install grafana-clock-panel  # Install Grafana clock panel plugin<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">ELK Stack (Elasticsearch, Logstash, Kibana)<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Elasticsearch (Search Engine for Logging and Data Analytics)<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">curl -XGET 'localhost:9200\/_cluster\/health?pretty'  \n# Get cluster health status  \n# Example:  \ncurl -XGET 'localhost:9200\/_cluster\/health?pretty'  # Check the health of your Elasticsearch cluster<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Logstash (Server-Side Data Processing Pipeline)<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\">logstash -f &lt;config_file>  \n# Run Logstash with the specified configuration file  \n# Example:  \nlogstash -f \/etc\/logstash\/conf.d\/logstash.conf  # Run Logstash with a specific configuration file<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Kibana (Web Interface for Visualizing Elasticsearch Data)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-shell-session\"># Kibana is generally accessed through a web browser\n# Access Kibana interface at:\nhttp:\/\/localhost:5601  \n# Example:  \n# Open Kibana dashboard in the web browser to visualize data<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mastering Linux starts with knowing the right commands. This Linux Commands Cheat Sheet is your go-to guide, offering quick access to essential commands that can simplify your tasks. From file management to system checks, this cheat sheet ensures you\u2019re always equipped to get things done efficiently. Whether you&#8217;re just starting or looking to boost your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1225],"tags":[],"class_list":["post-2772","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/comments?post=2772"}],"version-history":[{"count":5,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2772\/revisions"}],"predecessor-version":[{"id":2777,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/2772\/revisions\/2777"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=2772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=2772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=2772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}