Skip to content

Networking Commands

Networking commands are essential for managing and troubleshooting network settings and connections in Bash. This section covers the basic commands for networking.


ping

ping is used to check the network connection to a host.

ping google.com

ping_exemple.png

Here are some useful flags you can use with ping:

Flag Description
-c Number of packets to send.
-i Interval between packets.
-t Set the TTL (time to live).

curl

curl is used to transfer data from or to a server.

curl https://example.com

Examples

  • Download a file:
    curl -O https://example.com/file.zip
    
  • Post data to a server:
    curl -d "param1=value1&param2=value2" -X POST https://example.com
    

wget

wget is used to retrieve files from the web.

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

Here are some useful flags you can use with wget:

Flag Description
-b Run in the background.
-q Quiet mode.
-c Continue downloading a partially downloaded file.

Next Step

Now that you know how to perform basic networking tasks, check out the next section on Scripting with Bash to learn how to automate tasks in Bash.

Previous | Next