Networking Commands
Networking Commands
1. ping
• What it does: Checks if a device or server is reachable over the network by sending
ICMP packets.
• Use cases:
2. netstat
• What it does: Displays network connections, routing tables, and active ports on your
system.
• Use cases:
3. ifconfig
• What it does: Shows or configures the network interfaces on a system.
• Use cases:
4. traceroute
• What it does: Tracks the path packets take to reach a specific destination, listing each
hop.
• Use cases:
6. nslookup
• What it does: Queries DNS servers to get domain name to IP address mappings.
• Use cases:
• Use cases:
8. telnet
• What it does: Connects to remote servers on a specific port to test connectivity.
• Use cases:
10. whois
• What it does: Queries information about domain registrations and owners.
• Use cases:
11. curl
• What it does: Transfers data from or to a server using various protocols (HTTP, FTP,
etc.).
• Use cases:
o Test APIs.
o Download or send data from/to a server.
12. wget
• What it does: Downloads files from the web using HTTP, HTTPS, or FTP.
• Use cases:
1. ping
• Example:
ping google.com
Explanation: This sends packets to google.com to check if it's reachable and measures the
response time.
2. netstat
• Example:
netstat -tuln
Explanation: Shows all active listening ports (-t for TCP, -u for UDP, -l for listening ports, -n
to show numeric addresses).
3. ifconfig
• Example:
ifconfig
Explanation: Displays the configuration of all network interfaces, including IP addresses and
status.
4. traceroute
• Example:
traceroute google.com
Explanation: Traces the path from your computer to google.com, showing each hop along
the way.
5. mtr
• Example:
mtr google.com
Explanation: Provides a real-time, continuous trace to google.com with latency and packet
loss stats.
6. nslookup
• Example:
nslookup google.com
Explanation: Looks up the domain name associated with the IP address 8.8.8.8 (Google's
DNS server).
8. telnet
• Example:
telnet google.com 80
Explanation: Connects to google.com on port 80 (HTTP) to test if the port is open and
accessible.
9. dig
• Example:
dig google.com
Explanation: Performs a detailed DNS query for google.com, including IP addresses and
other DNS records
10. whois
• Example:
whois google.com
Explanation: Retrieves information about the domain google.com, including the owner,
registrar, and expiration date.
11. curl
• Example:
curl https://jsonplaceholder.typicode.com/todos/1
Explanation: Fetches data from a sample API (JSON format) from jsonplaceholder and
prints it to the terminal.
12. wget
• Example:
wget https://example.com/file.zip
Explanation: Downloads the file file.zip from example.com to your current directory.