Network

Command
Description
Example

ping [host]

Test network connectivity to a host.

ping google.com → Tests connection to google.com.

ifconfig / ip addr

Show network interface information.

ip addr → Displays IP addresses and network interfaces.

curl [URL]

Transfer data from or to a server.

curl https://example.com → Fetches the webpage content.

wget [URL]

Download files from the web.

wget https://example.com/file.zip → Downloads file.zip.

ssh [user]@[host]

Connect to a remote host via SSH.

ssh user@192.168.1.1 → Connects to a remote server.

scp [src] [dest]

Securely copy files between hosts.

scp file.txt user@192.168.1.1:/home/user/ → Copies file.txt to a remote host.

netstat -tuln

List open ports and active network connections.

netstat -tuln → Displays listening ports and services.

nslookup [host]

Query DNS information for a domain or IP address.

nslookup google.com → Retrieves the IP address of google.com.

telnet [host] [port]

Test connectivity to a specific port on a server.

telnet example.com 80 → Tests connectivity to port 80 on example.com.

Last updated