This page covers commands essential for network configuration, testing connectivity, and secure remote operations.
26. ip
- Show / Manipulate Routing, Devices, Policy Routing and Tunnels
Purpose: The ip
command is a modern and powerful tool for showing and manipulating routing, network devices, policy routing, and tunnels. It's the successor to older commands like ifconfig
and route
.
Syntax: ip [OPTIONS] OBJECT COMMAND
Key Objects/Commands:
ip addr show
: Display IP addresses and device information.ip link show
: Display network device status.ip route show
: Display the routing table.ip neigh show
: Display ARP table (neighbor cache).
Examples:
ip addr show ip link show eth0 ip route show default
27. ping
- Send ICMP ECHO_REQUEST to Network Hosts
Purpose: The ping
command is used to test the reachability of a host on an Internet Protocol (IP) network. It measures the round-trip time for messages sent from the originating host to a destination computer and back.
Syntax: ping [OPTIONS] DESTINATION
Key Options:
-c COUNT
: Stop after sending COUNT ECHO_REQUEST packets.-t TTL
: Set the IP Time To Live.
Examples:
ping google.com ping -c 4 192.168.1.1
28. ssh
- OpenSSH SSH Client (Remote Login Program)
Purpose: The ssh
command (Secure Shell) is a protocol for securely operating network services over an unsecured network. It's widely used for remote command-line login and executing commands on a remote server.
Syntax: ssh [OPTIONS] USER@HOST
Key Options:
-p PORT
: Specify the port to connect to on the remote host.-i IDENTITY_FILE
: Selects a file from which the identity (private key) for public key authentication is read.
Examples:
ssh youruser@your_server_ip ssh -p 2222 admin@remote.example.com ssh -i ~/.ssh/my_key_pair.pem ec2-user@ec2-1-2-3-4.compute-1.amazonaws.com
29. scp
- Secure Copy (Remote File Copy Program)
Purpose: The scp
command (Secure Copy) is used to securely copy files between local and remote hosts, or between two remote hosts. It uses SSH for data transfer and authentication.
Syntax: scp [OPTIONS] SOURCE DESTINATION
Key Options:
-r
: (recursive) Copies directories recursively.-P PORT
: Specifies the port to connect to on the remote host (note uppercase P for port).
Examples:
scp local_file.txt user@remote:/path/to/destination/ scp user@remote:/path/to/source/remote_file.log . scp -r my_local_folder user@remote:/home/user/backups/ scp -P 2222 remote_user@server_b:/path/to/file.conf .
30. wget
- Non-interactive Network Downloader
Purpose: The wget
command is a free utility for non-interactive download of files from the web. It supports HTTP, HTTPS, and FTP protocols.
Syntax: wget [OPTIONS] URL
Key Options:
-O FILE
: Save the document to a specific file name.-P DIR
: Set directory prefix to DIR.-c
: (continue) Resume getting a partially downloaded file.--no-check-certificate
: Don't validate the server certificate (use with caution).
Examples:
wget https://example.com/software.tar.gz wget -O my_doc.pdf https://example.com/documents/report.pdf wget -P ~/downloads/ http://ftp.gnu.org/pub/gnu/wget/wget-1.20.3.tar.gz