Data moves invisibly across your network every day, and when something goes wrong, the difference between a five-minute fix and a five-hour outage comes down to knowing exactly where to look. Command-line tools bypass the guesswork and put you in control. These are the seven network commands every IT professional should know. Before we begin, be sure to subscribe to NinjaOne’s IT video hub and our YouTube channel for more tech content like this. We’ll start with “ping”, which tests whether a device is reachable. Type “ping” followed by the hostname or IP address, and your system sends packets across the network and measures the response. For continuous monitoring, in Windows, add the “-t” flag; on Linux and macOS, run “ping” without any parameters. Second, “tracert”—or “traceroute” on Linux and macOS—maps every hop your data takes to reach its destination. To use this command, run it against any hostname and watch the route unfold. Latency spikes and dropped packets point you straight to the bottleneck. Third, “ipconfig” on Windows—or “ifconfig” on macOS and some Linux systems —displays your IP address, subnet mask, gateway, and DNS servers instantly. If you need everything, add the “/all” flag on Windows or “-a” on Unix systems. Note that for modern Linux users, the “ip” command, specifically “ip a” or “ip addr” has largely replaced “ifconfig” and provides more powerful networking and routing capabilities. Fourth, “netstat” shows every active connection and open port on your machine. Run “netstat -an” for a clean numerical overview. On Windows, add “-b” to tie those connections back to specific applications. On Linux, use “-p” for the same effect. Fifth, “nslookup” queries DNS servers, translating domain names into IP addresses and telling you which server provided the answer. For deeper investigation, launch interactive mode by running “nslookup” without any parameters. Sixth, “arp” maps IP addresses to physical MAC addresses on your local network. Run “arp -a” to display your system’s ARP cache, a table of IP-to-MAC address mappings for every known device on the segment. You can also add static entries with “arp -s” or remove them with “arp -d”. Finally, “nmap” lets you scan entire networks. A quick scan looks like this—”nmap -T4 -F”—followed by your target. For a more comprehensive profile, add this flag: “-sS -sU -A -v”. If you need to identify the operating system, use “-O”. If you’re checking for common vulnerabilities, “--script vuln” runs a set of NSE vulnerability checks that may identify potential issues Only scan systems and networks you own or have explicit permission to assess, as unauthorized scanning may violate security policies or local laws. Overall, these commands offer insight into different layers of your network. The real power comes when you chain them together. Build these into your workflow and script the repetitive ones. For more information, check out our official blog post on the top 7 network commands, linked in the description below.

Top 7 Network Commands You Should Know

If you need an easier way to manage your complex network environment, pinpoint issues in it, and overall optimize performance, we’ve got you covered. In this video, we’ll talk about the top 7 network commands you should know, along with how to use them in your network, whether you’re running Windows, macOS, or Linux.

Read the full blog on Top 7 Network Commands You Should Know

Never miss a NinjaOne video!