Linux nm* Command Set: Comprehensive Overview

Author: System Administration Reference
Date: October 2025
Topic: Network Management and Symbol Table Commands

Introduction

The nm* command family in Linux/UNIX encompasses several distinct utilities, primarily divided into two categories:

  1. Network Management Tools - Commands like nmcli, nmtui, and nm-connection-editor that interface with NetworkManager
  2. Symbol Table Tools - The nm command itself, used for examining binary object files

1. NetworkManager Command Suite

1.1 nmcli - NetworkManager Command Line Interface

Purpose: Primary command-line tool for controlling NetworkManager and reporting network status

Basic Syntax

nmcli [OPTIONS] OBJECT { COMMAND | help }

Common Objects

Object Description Common Usage
general NetworkManager general status and operations nmcli general status
networking Overall networking control nmcli networking on/off
radio Radio switch management (WiFi, WWAN) nmcli radio wifi on
connection Network connection profiles nmcli connection show
device Network device management nmcli device status

Essential nmcli Commands

Viewing Network Status
# Show all connections
nmcli connection show

# Show all devices and their status
nmcli device status

# Show detailed device information
nmcli device show eth0

# Show NetworkManager status
nmcli general status
Managing Connections
# Activate a connection
nmcli connection up "connection-name"

# Deactivate a connection
nmcli connection down "connection-name"

# Delete a connection
nmcli connection delete "connection-name"

# Reload connection files from disk
nmcli connection reload
Creating Connections
# Create a new Ethernet connection with DHCP
nmcli connection add type ethernet con-name "MyEthernet" ifname eth0

# Create a static IP connection
nmcli connection add type ethernet con-name "StaticIP" ifname eth0 \
  ip4 192.168.1.100/24 gw4 192.168.1.1

# Create a WiFi connection
nmcli device wifi connect "SSID" password "password"

# Create WiFi connection with specific settings
nmcli connection add type wifi con-name "MyWiFi" ifname wlan0 ssid "SSID" \
  wifi-sec.key-mgmt wpa-psk wifi-sec.psk "password"
Modifying Connections
# Modify IP address
nmcli connection modify "MyConnection" ipv4.addresses 192.168.1.150/24

# Modify DNS servers
nmcli connection modify "MyConnection" ipv4.dns "8.8.8.8 8.8.4.4"

# Change to DHCP
nmcli connection modify "MyConnection" ipv4.method auto

# Add additional IP address
nmcli connection modify "MyConnection" +ipv4.addresses 192.168.1.151/24
Note: After modifying a connection, you typically need to bring it down and up again for changes to take effect:
nmcli connection down "MyConnection" && nmcli connection up "MyConnection"

nmcli Output Formatting

# Terse output (script-friendly)
nmcli -t device status

# Custom fields
nmcli -f NAME,TYPE,DEVICE connection show

# Pretty output (default)
nmcli -p device status

# Colored output
nmcli -c yes device status

1.2 nmtui - NetworkManager Text User Interface

Purpose: Curses-based text UI for NetworkManager configuration

A menu-driven interface for users who prefer a visual approach without requiring a full GUI.

Usage

# Launch main menu
nmtui

# Directly edit connections
nmtui edit

# Directly activate connections
nmtui connect

# Set system hostname
nmtui hostname
Tip: nmtui is excellent for quick configuration on servers without X11, or when SSH'd into remote systems. Navigation uses arrow keys, Tab, and Enter.

1.3 nm-connection-editor - GUI Connection Editor

Purpose: Graphical tool for creating and editing NetworkManager connections

Full-featured GUI application for desktop environments. Provides comprehensive access to all connection settings including VPN, bonding, bridging, and advanced options.

# Launch connection editor
nm-connection-editor

# Edit specific connection
nm-connection-editor -c "connection-name"

1.4 Other NetworkManager Tools

nm-online

Utility to determine if NetworkManager is online (has network connectivity)

# Wait for network connectivity (useful in scripts)
nm-online -t 30  # Wait up to 30 seconds

# Check connectivity status
nm-online -q && echo "Online" || echo "Offline"

nmcli monitor

Monitor NetworkManager changes in real-time

# Monitor all NetworkManager activity
nmcli monitor

# Monitor specific connection
nmcli connection monitor "MyConnection"

2. nm - Symbol Table Examination Tool

2.1 Overview

Purpose: List symbols from object files, libraries, and executables

The nm command is part of the GNU binutils package and is essential for examining compiled binaries, debugging, and understanding program structure.

2.2 Basic Syntax

nm [OPTIONS] [FILE...]

2.3 Common Options

Option Description
-A Display filename before each symbol
-a Display all symbols, including debugger-only
-C Demangle C++ symbol names
-D Display dynamic symbols only
-g Display only external symbols
-n Sort numerically by address
-p Don't sort; display in symbol table order
-u Display only undefined symbols
-l Display line number information
--size-sort Sort by symbol size

2.4 Symbol Types

nm displays a letter code for each symbol indicating its type:

Code Description
A Absolute symbol (value won't change with relocation)
B/b Uninitialized data (BSS) - uppercase for global, lowercase for local
C Common symbol (uninitialized data)
D/d Initialized data section
G/g Initialized data for small objects
I Indirect reference to another symbol
N Debugging symbol
R/r Read-only data section
S/s Uninitialized data for small objects
T/t Text (code) section
U Undefined symbol
V/v Weak object
W/w Weak symbol (untagged weak if not T/D/B)
- Stabs symbol (debugging)
? Unknown type
Note: Uppercase letters indicate global (external) symbols, while lowercase indicates local (static) symbols.

2.5 Practical Examples

Basic Usage

# List all symbols in a binary
nm /bin/ls

# List symbols in a library
nm /usr/lib/libc.so.6

# List symbols in object file
nm myprogram.o

Filtering and Analysis

# Show only undefined symbols (dependencies)
nm -u /bin/ls

# Show only global (external) symbols
nm -g myprogram.o

# Show dynamic symbols only
nm -D /usr/lib/libssl.so

# Demangle C++ symbols
nm -C mycppprogram

# Sort by symbol size (find largest symbols)
nm --size-sort -S mybinary

# Find specific symbol
nm mybinary | grep "main"

# Show line numbers (if debug info available)
nm -l mybinary

Library Analysis

# List all functions exported by a shared library
nm -D --defined-only /usr/lib/libpthread.so.0

# Find what symbols a program needs
nm -u myprogram

# Check if a library provides a specific symbol
nm -D /usr/lib/libm.so.6 | grep "sin"

Debugging Scenarios

# Find duplicate symbols across multiple object files
nm *.o | grep " T " | sort

# Identify missing symbols causing link errors
nm -u myprogram | grep " U "

# Compare symbols between two versions of a library
nm libfoo.so.1 > v1_symbols.txt
nm libfoo.so.2 > v2_symbols.txt
diff v1_symbols.txt v2_symbols.txt

3. Related Commands and Tools

3.1 Network-Related

# Control NetworkManager service
systemctl status NetworkManager
systemctl restart NetworkManager
systemctl enable NetworkManager

# View NetworkManager logs
journalctl -u NetworkManager -f

3.2 Binary Analysis Tools

4. Configuration Files

4.1 NetworkManager Configuration

Main Configuration

Location: /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns=default

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=yes

Connection Profiles

Location: /etc/NetworkManager/system-connections/

Each connection is stored as a separate file with restrictive permissions (600).

Security Warning: Connection files may contain passwords and should never be world-readable.

4.2 Example Connection File

[connection]
id=MyEthernet
uuid=12345678-1234-1234-1234-123456789abc
type=ethernet
autoconnect=true
interface-name=eth0

[ethernet]

[ipv4]
method=manual
address1=192.168.1.100/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;

[ipv6]
method=auto

5. Common Use Cases and Workflows

5.1 Setting Up Static IP Address

# Method 1: Using nmcli
nmcli connection modify "Wired connection 1" \
  ipv4.method manual \
  ipv4.addresses "192.168.1.100/24" \
  ipv4.gateway "192.168.1.1" \
  ipv4.dns "8.8.8.8,8.8.4.4"

nmcli connection up "Wired connection 1"

# Method 2: Using nmtui
nmtui edit

5.2 Troubleshooting Network Issues

# Check device status
nmcli device status

# Check connection status
nmcli connection show --active

# Restart NetworkManager
systemctl restart NetworkManager

# Check logs
journalctl -u NetworkManager -n 50

# Test connectivity
nmcli general status
ping -c 4 8.8.8.8

5.3 Finding Symbol Dependencies

# Find what libraries a program needs
ldd /bin/ls

# Find undefined symbols in object file
nm -u myprogram.o

# Verify library provides required symbol
nm -D /usr/lib/libfoo.so | grep "symbol_name"

# Check for symbol conflicts
nm *.o | grep " T symbol_name"

6. Best Practices and Tips

6.1 NetworkManager Best Practices

6.2 Symbol Analysis Best Practices

7. Scripting Examples

7.1 Network Configuration Script

#!/bin/bash
# Check if connection exists, create if not

CONNECTION="MyStaticIP"
INTERFACE="eth0"
IP="192.168.1.100/24"
GATEWAY="192.168.1.1"
DNS="8.8.8.8,8.8.4.4"

if nmcli connection show "$CONNECTION" &>/dev/null; then
    echo "Connection exists, modifying..."
    nmcli connection modify "$CONNECTION" \
        ipv4.addresses "$IP" \
        ipv4.gateway "$GATEWAY" \
        ipv4.dns "$DNS"
else
    echo "Creating new connection..."
    nmcli connection add \
        type ethernet \
        con-name "$CONNECTION" \
        ifname "$INTERFACE" \
        ipv4.method manual \
        ipv4.addresses "$IP" \
        ipv4.gateway "$GATEWAY" \
        ipv4.dns "$DNS"
fi

nmcli connection up "$CONNECTION"

7.2 Symbol Analysis Script

#!/bin/bash
# Find all undefined symbols across multiple object files

echo "Undefined symbols across all object files:"
for obj in *.o; do
    echo "=== $obj ==="
    nm -u "$obj" | grep " U " | awk '{print $2}' | sort -u
done

8. Troubleshooting Guide

8.1 NetworkManager Issues

Problem Solution
Connection not appearing nmcli connection reload
Changes not taking effect Bring connection down and up again
Can't modify system connections Check permissions, may need sudo
NetworkManager not running systemctl start NetworkManager
DNS not working Check /etc/resolv.conf and DNS settings

8.2 nm Symbol Issues

Problem Solution
No symbols in file Binary may be stripped; use file to check
Mangled C++ names Use nm -C to demangle
Can't find symbol Try nm -a for all symbols including debug
Wrong architecture Verify with file command

9. Additional Resources

Man Pages

man nmcli
man nmcli-examples
man nm-settings
man nm-online
man NetworkManager.conf
man nm

Online Documentation

← Back to NetworkManager Index ↑ Back to EXPANDED