Manage, script and diagnose network connections directly from the terminal with nmcli. 17.04.2026 | reading time: 2 min When the GUI is not available or when automation is required, nmcli is the command-line interface to NetworkManager that lets the administrator list devices, create connections, and bring interfaces up or down in scripts or interactively. Create and activate an Ethernet connection Follow these commands to add a simple Ethernet connection and activate it; the block shows both input and typical output: ```bash $ nmcli device status DEVICE TYPE STATE CONNECTION eth0 ethernet disconnected -- wlan0 wifi unmanaged -- $ nmcli connection add type ethernet ifname eth0 con-name office-eth0 autoconnect yes Connection 'office-eth0' (uuid 123e4567-e89b-12d3-a456-426614174000) successfully added. $ nmcli connection up office-eth0 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/...). $ nmcli connection show --active NAME UUID TYPE DEVICE office-eth0 123e4567-e89b-12d3-a456-426614174000 ethernet eth0 ``` Scan Wi‑Fi and inspect details Scan networks, list SSIDs, and see signal and security quickly with commands like `nmcli device wifi rescan` and `nmcli device wifi list`; to retrieve a machine-friendly line output use `nmcli -t -f SSID,SIGNAL,SECURITY device wifi list` and parse it in a script. Automate and script reliably Use terse output formats, predictable exit codes, and fields selection to integrate nmcli into scripts, for example `nmcli -t -f UUID,NAME connection show --active` returns a colon-separated list that the administrator can loop over in shell scripts. Tools that complement nmcli For interactive text-based menus use `nmtui`; for low-level IP configuration use the `ip` tool from iproute2; for WPA handling on some setups `wpa_supplicant` remains relevant; combine these with nmcli when diagnosing complex failures. Finish and next steps Mastering nmcli accelerates troubleshooting and automation of network tasks; keep practicing on real systems and consider formal study toward CompTIA Linux+ or LPIC-1, with intensive exam preparation at bitsandbytes.academy to turn practical skill into certification. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities scripting troubleshooting