Which Linux networking commands should I know for a scripting assessment?
Asked by
MellowCedar42
I have a live technical assessment tomorrow with a company that works with routers and IoT devices, particularly Wi-Fi and AI-sensing applications. I was told I may need to write a Linux shell script and then use its output in Python. Which networking commands and related concepts would be most useful to review, and are there any practical tips or examples that could help me prepare?
Answers
Start with the modern iproute2 tools, especially `ip addr` for interface addresses, `ip link` for interface state, `ip route` for routing information, and `ip neigh` for the ARP or neighbor table. The `ip` command can often produce JSON with options such as `-j`, which makes it much easier to pass structured data into Python instead of parsing human-readable text. Also review `ss` for sockets and listening ports, plus `ping` and `traceroute` or `tracepath` for basic connectivity checks.
Reply to this answer
For a hands-on assessment, be comfortable combining commands in a shell script and checking their exit status. Useful tools include `ip`, `ss`, `ping`, `tracepath`, `dig` or `resolvectl` for DNS, `curl` for application-level connectivity, and `tcpdump` for inspecting packets when you need deeper troubleshooting. For Wi-Fi-specific work, take a look at `iw` and commands that show the connected interface, signal level, channel, and link status. In Python, prefer calling commands with `subprocess.run()` using argument lists, capture the output explicitly, and parse JSON whenever the command supports it rather than splitting arbitrary text.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowCedar42: Thatโs exactly the kind of practical direction I was looking for. Iโll focus on `iproute2`, especially the JSON output and how to consume it safely from Python.