Networking Commands in Linux
Networking is a pivotal part of Linux system administration. Below is an explanation of some crucial networking commands:
ping host: Sends ICMP ECHO_REQUEST packets to a host to test connectivity and measure response time.whois domain: Queries WHOIS databases to retrieve domain registration information.dig domain: Queries DNS servers for information about domain name resolutions and other DNS records.netstat -pnltu: Displays various network information, including active connections, listening ports, and protocol statistics.ifconfig: Displays the configuration of the system’s network interfaces, including IP addresses.ssh user@host: Initiates a secure shell connection to a remote host as the specified user.scp: Securely copies files between hosts over the SSH protocol.wget url: Downloads files from the Internet using HTTP, HTTPS, and FTP protocols.curl url: Transfers data to or from a server using various protocols and can be used to request URLs.traceroute domain: Traces the path packets take from the local machine to the remote domain.mtr domain: Combines the functionality oftracerouteandpingto provide a comprehensive network diagnostic tool.ss: A utility that provides information about sockets. It is used as a modern replacement fornetstat.nmap: A powerful network scanner used to discover devices and services on a computer network and for security auditing.

Archives and Compression Commands
Handling file compression and archives is often necessary for data storage and transfer:
tar cf file.tar files: Creates an archive file namedfile.tarcontaining the specified files or directories.tar xf file.tar: Extracts the files from an archive namedfile.tar.gzip file: Compresses the specified file and renames it tofile.gz.gzip -d file.gz: Decompressesfile.gzback to its original format.zip -r file.zip files: Creates a compressed zip archive namedfile.zip.unzip file.zip: Extracts the contents of the zip archive.
Text Processing Commands
Text processing is an everyday task in Linux. Here are some commands used to search and manipulate text:
grep pattern files: Searches for a specific pattern in files.grep -r pattern dir: Recursively search for a pattern within a directory.command | grep pattern: Pipes the output of a command intogrepto search for a pattern.echo 'text': Outputs the text to the terminal.sed 's/string1/string2/g' filename: Replaces occurrences ofstring1withstring2in a file.diff file1 file2: Shows the differences between two files.wc filename: Counts the lines, words, and characters in a file.awk: A programming language used for text processing and manipulation.sed -i 's/string1/string2/g' filename: Similar tosedbut edits the file in place without requiring output redirection.cut -d':' -f1 /etc/passwd: Cuts out and displays the first field of each line in/etc/passwd, using colon as the delimiter.
Disk Usage Commands
Monitoring disk usage is essential for maintaining system health:
df: Displays the amount of disk space used and available on all mounted filesystems.du: Shows the disk space used by directories.free: Shows the amount of free and used memory in the system, including swap.whereis app: Searches for possible locations of an application.
System Information Commands
Gathering system information is often necessary for troubleshooting and system monitoring:
date: Displays or sets the system date and time.cal: Displays a calendar of the current month.uptime: Shows how long the system has been running.w: Displays who is currently logged in and their activity.whoami: Displays the username of the current user.uname -a: Provides a wide range of system information, including the kernel name, version, and other details.df -h: Shows disk space usage in a human-readable format.du -sh: Displays the disk usage of the current directory in a human-readable format.free -m: Displays the amount of free and used memory in megabytes.
These commands are fundamental for managing network resources, data compression, text processing, disk utilization, and retrieving system information. They provide a solid foundation for Linux users to perform various tasks effectively.