Essential Network Commands on Linux (ping, ifconfig, ip)
ip, ping, ss and why ifconfig and netstat are no longer the recommended option.
| Command | What it's for |
|---|---|
ip a | See your IP addresses (replaces ifconfig) |
ping [address] | Check if there's a connection to a destination |
ip route | See your network's gateway |
ss -tulnp | See listening ports (replaces netstat) |
dig / nslookup | Query a domain's DNS |
ifconfig and netstat are deprecated on many modern
distributions (though they still work on some if you install them
separately). ip and ss are their actively
maintained replacements — worth getting used to from the start.
Quick connection diagnosis
ping -c 4 8.8.8.8
-c 4 limits it to 4 attempts — without this, ping would
keep going indefinitely until you stop it manually with
Ctrl + C.
Frequently asked questions
Why doesn't ping stop on its own?
By default, ping keeps going indefinitely until you stop it with Ctrl + C. Use the -c option followed by a number to limit how many attempts it makes automatically.
Should I learn ifconfig if I keep seeing it in old tutorials?
It isn't necessary to get started — 'ip a' does the same thing and is the actively maintained command. Knowing ifconfig only helps with understanding older guides that still use it.