Rocky Linux Core Commands: Page 6

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:

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:

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:

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:

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:

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