A modern, beautiful CLI tool for network monitoring and process management
A beautifully designed network monitoring tool built with Go that provides an intuitive interface for viewing active ports, network interfaces, routing tables, and managing processes on Linux, macOS, and Windows.
Features • Installation • Usage • Commands
- 📋 Port Listing - Display all active TCP/UDP ports with detailed process metrics
- Process owner (username)
- CPU usage percentage
- Memory usage percentage
- 🌐 Network Interfaces - View network interface information with IP addresses
- IPv4 addresses by default
- IPv6 support with
-aflag - Filter interfaces with active IPs
- 🛣️ Routing Table - Display system routing information with smart filtering
- Native OS APIs (Netlink on Linux, BSD routing socket on macOS, Win32 API on Windows)
- Smart filtering (excludes /32 hosts, link-local, multicast, broadcast)
- Cross-platform compatible
- 🗺️ Traceroute - Trace network path to destination with animated loading
- Cross-platform support (traceroute/tracert)
- Beautiful table format with color-coded RTT values
- Real-time animated spinner during execution
- 📊 Network Statistics - View network statistics summary at a glance
- Connection counts (TCP/UDP)
- Listening ports count
- Network interfaces count
- Default gateway information
- Top processes by connection count
- 🌐 DNS Lookup - Perform DNS lookups with clean output
- Forward lookup (A and AAAA records)
- Reverse lookup (PTR records)
- Response time measurement
- No external dependencies (uses Go's net package)
- Smart Process Search - Find processes by PID or port with automatic detection
- Provide a number to search by both PID and port simultaneously
- Shows full command line (like
ps -ef) for easy identification - Displays all active ports used by the process
- Process Shutdown - Safely terminate processes with interactive confirmation
- Real-time Metrics - Monitor CPU and memory usage per process
- Beautiful UI - Modern terminal interface with color-coded output
- Center-aligned Headers - Clean, organized table layouts
- Optimized Columns - Compact display for better terminal compatibility
- Automatic Sorting - Port listings sorted by port number for easy scanning
- Shell Completion - Tab completion support for Bash, Zsh, and Fish
- Fast & Lightweight - Built with Go for optimal performance
brew install zzzzseong/netmon/netmonThe easiest way to install on Linux:
# Install latest version
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash
# Install specific version
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.3.0The script automatically:
- Detects OS and architecture (Linux AMD64/ARM64)
- Installs
traceroutedependency (required fortraceroutecommand) - Downloads the latest version
- Installs to
/usr/local/bin - Installs shell completions (Bash, Zsh, Fish)
- Verifies installation
After installation, you can immediately use netmon:
netmon ls # List active ports
netmon ip # Show network interfaces
netmon --help # Show all commandsNote: If
netmonis not found after installation, try opening a new terminal or runhash -rto refresh the command cache.
Pre-built binaries are available in the Releases section.
For Linux:
netmon-linux-amd64.tar.gz(Intel/AMD 64-bit)netmon-linux-arm64.tar.gz(ARM 64-bit)
For macOS:
netmon-darwin-amd64.tar.gz(Intel)netmon-darwin-arm64.tar.gz(Apple Silicon)
Installation:
# Download and extract
tar -xzf netmon-<platform>-<arch>.tar.gz
# Install (optional)
sudo mv netmon /usr/local/bin/
# Verify executable permissions
chmod +x /usr/local/bin/netmonPrerequisites:
- Go 1.25 or higher
traceroutecommand (fortraceroutefunctionality)- Linux:
sudo apt-get install traceroute(Debian/Ubuntu) orsudo yum install traceroute(RHEL/CentOS) - macOS: Usually pre-installed, or
brew install traceroute - Windows: Uses built-in
tracertcommand
- Linux:
# Clone the repository
git clone https://github.com/zzzzseong/netmon.git
cd netmon
# Build
go build -o netmon .
# Install (optional)
sudo mv netmon /usr/local/bin/Display all active listening ports with detailed process information:
# Show TCP LISTEN connections only (default)
netmon lsOutput:
╭────────────┬─────────────────────┬────────────┬───────────┬───────────────────────────┬─────────────────┬───────────┬──────────╮
│ PROTOCOL │ LOCAL ADDRESS │ STATUS │ PID │ PROCESS NAME │ USERNAME │ CPU % │ MEM % │
├────────────┼─────────────────────┼────────────┼───────────┼───────────────────────────┼─────────────────┼───────────┼──────────┤
│ TCP │ 127.0.0.1:8080 │ LISTEN │ 12345 │ node │ jisung │ 15.2% │ 2.1% │
│ TCP │ *:3000 │ LISTEN │ 23456 │ nginx │ jisung │ 2.5% │ 0.8% │
╰────────────┴─────────────────────┴────────────┴───────────┴───────────────────────────┴─────────────────┴───────────┴──────────╯
# Include UDP connections with -a flag
netmon ls -aOutput:
╭────────────┬─────────────────────┬────────────┬───────────┬───────────────────────────┬─────────────────┬───────────┬──────────╮
│ PROTOCOL │ LOCAL ADDRESS │ STATUS │ PID │ PROCESS NAME │ USERNAME │ CPU % │ MEM % │
├────────────┼─────────────────────┼────────────┼───────────┼───────────────────────────┼─────────────────┼───────────┼──────────┤
│ TCP │ 127.0.0.1:8080 │ LISTEN │ 12345 │ node │ jisung │ 15.2% │ 2.1% │
│ TCP │ *:3000 │ LISTEN │ 23456 │ nginx │ jisung │ 2.5% │ 0.8% │
│ UDP │ 127.0.0.1:53 │ NONE │ 567 │ systemd-resolved │ root │ 0.1% │ 0.3% │
╰────────────┴─────────────────────┴────────────┴───────────┴───────────────────────────┴─────────────────┴───────────┴──────────╯
Display network interfaces with IP addresses:
# Show IPv4 addresses only (default)
netmon ipOutput:
╭──────────────┬──────────────────────────────────────────┬──────────────────────┬─────────────┬─────────────╮
│ INTERFACE │ IP ADDRESS │ MAC ADDRESS │ STATUS │ MTU │
├──────────────┼──────────────────────────────────────────┼──────────────────────┼─────────────┼─────────────┤
│ en0 │ 192.168.1.100/24 │ a4:83:e7:5c:5d:3e │ UP │ 1500 │
│ lo0 │ 127.0.0.1/8 │ N/A │ UP │ 16384 │
╰──────────────┴──────────────────────────────────────────┴──────────────────────┴─────────────┴─────────────╯
# Show all addresses including IPv6
netmon ip -aDisplay system routing information with smart filtering:
netmon routeOutput:
╭───────────────────────────┬───────────────────────────┬───────────────────────────┬───────────────────────────┬──────────────────────────╮
│ DESTINATION │ GATEWAY │ INTERFACE │ METRIC │ SOURCE │
├───────────────────────────┼───────────────────────────┼───────────────────────────┼───────────────────────────┼──────────────────────────┤
│ default │ 172.16.3.254 │ en0 │ - │ 172.16.0.99 │
│ 172.16.0.0/22 │ - │ en0 │ - │ 172.16.0.99 │
│ 10.10.0.0/24 │ - │ docker0 │ - │ 10.10.0.1 │
╰───────────────────────────┴───────────────────────────┴───────────────────────────┴───────────────────────────┴──────────────────────────╯
Trace the network path to a destination with animated loading indicator:
netmon traceroute <host>Example:
netmon traceroute google.comOutput:
◐ Tracing route to google.com...
╭──────────┬──────────────────────────────────────────┬──────────────┬──────────────┬──────────────╮
│ HOP │ HOST │ RTT 1 │ RTT 2 │ RTT 3 │
├──────────┼──────────────────────────────────────────┼──────────────┼──────────────┼──────────────┤
│ 1 │ 192.168.1.1 │ 2.5 ms │ 2.3 ms │ 2.1 ms │
│ 2 │ 10.0.0.1 │ 15.2 ms │ 14.8 ms │ 15.0 ms │
│ 3 │ 172.217.160.46 │ 25.3 ms │ 24.9 ms │ 25.1 ms │
╰──────────┴──────────────────────────────────────────┴──────────────┴──────────────┴──────────────╯
Display network statistics summary:
netmon statsOutput:
╭────────────────────────────────────────────────────────────╮
│ │
│ Network Summary │
│ │
│ Active TCP Connections: 150 │
│ Active UDP Connections: 0 │
│ Listening Ports: 42 │
│ Network Interfaces: 19 │
│ Default Gateway: 192.168.1.1 │
│ │
│ Top Processes by Connections: │
│ • chrome (25 connections) │
│ • node (12 connections) │
│ • docker (8 connections) │
│ │
╰────────────────────────────────────────────────────────────╯
Lookup DNS records for a domain or IP address:
# Forward lookup (domain to IP)
netmon dns google.comOutput:
🔍 DNS Lookup: google.com
╭───────────────┬──────────────────────────────────────────────────────────────╮
│ TYPE │ VALUE │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ A │ 142.250.206.206 │
│ AAAA │ 2404:6800:400a:813::200e │
╰───────────────┴──────────────────────────────────────────────────────────────╯
Response Time: 6ms
# Reverse lookup (IP to domain)
netmon dns 8.8.8.8Output:
🔍 DNS Lookup: 8.8.8.8
╭───────────────┬──────────────────────────────────────────────────────────────╮
│ TYPE │ VALUE │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ PTR │ dns.google. │
╰───────────────┴──────────────────────────────────────────────────────────────╯
Response Time: 3ms
Find processes using a smart search that automatically detects PID or port:
netmon find <pid|port>How it works:
- Provide a number, and
findautomatically searches by both PID and port - If both match, both results are shown (duplicates removed)
- If only one matches, only that result is displayed
- Shows full command line (like
ps -ef) for easy process identification - Displays active ports (LISTEN) and active connections (ESTABLISHED) for the found process
Examples:
# Search by port 8080
netmon find 8080
# Search by PID 8922
netmon find 8922
# If PID 8080 exists AND port 8080 is in use, both results shown
netmon find 8080Output:
🔍 Found by Port: 8080
╭──────────────────────────────────────────────────╮
│ PID: 12345 │
│ Name: node │
│ Status: [sleep] │
│ │
│ Command: │
│ /usr/bin/node /path/to/server.js │
│ │
│ Active Ports: │
│ • 127.0.0.1:8080 (TCP) │
│ │
│ Active Connections: │
│ • 127.0.0.1:8080 → 192.168.1.100:54321 │
╰──────────────────────────────────────────────────╯
Smart search that works with both PIDs and ports - shows active ports and connections!
Safely shutdown a process with interactive confirmation:
netmon shutdown <pid>Example:
netmon shutdown 12345The command will:
- 📊 Display detailed process information (PID, name, status, active ports)
- ❓ Show an interactive prompt for confirmation
- ✅ Safely shutdown the process if confirmed
Interactive Prompt:
⚠️ Shutdown Confirmation for PID 12345
╭─────────────────────────────────────╮
│ PID: 12345 │
│ Name: nginx │
│ Status: [S] │
│ │
│ Active Ports: │
│ • 0.0.0.0:8080 (TCP) │
╰─────────────────────────────────────╯
Are you sure you want to shutdown this process?
▸ ✓ Yes, shutdown
✗ No, cancel
| Command | Description | Usage | Flags |
|---|---|---|---|
ls |
List all active ports with process metrics | netmon ls |
-a (include UDP) |
ip |
Show network interfaces | netmon ip |
-a (show IPv6) |
route |
Display routing table with smart filtering | netmon route |
- |
stats |
Display network statistics summary | netmon stats |
- |
dns |
Perform DNS lookup | `netmon dns <domain | ip>` |
find |
Find process by PID or port (auto-detects) | `netmon find <pid | port>` |
shutdown |
Shutdown a process | netmon shutdown <pid> |
- |
traceroute |
Trace route to network host | netmon traceroute <host> |
- |
version |
Show version information | netmon version |
- |
help |
Show help information | netmon help |
- |
- 🔧 Port Conflict Resolution - Quickly find which process is using a port (smart PID/port search with active connections)
- 📊 Network Monitoring - Monitor network statistics and connections with real-time metrics
- 🛡️ Process Management - Safely terminate processes with confirmation
- 💻 Development - Check if your development server port is available
- 🌐 Network Debugging - View network interfaces and routing information
- 📈 Performance Monitoring - Track CPU and memory usage per process
- 📊 Network Statistics Command - Quick overview of network activity with connection counts, listening ports, and top processes
- 🌐 DNS Lookup Command - Fast DNS lookups (forward and reverse) with response time measurement
- 🔍 Enhanced Find Command - Now displays active connections for found processes
- 🎨 Enhanced Formatting - Beautiful table layouts for all new commands
- ⚡ Performance Improvements - Optimized connection filtering and DNS lookup performance
v1.2.2:
- 🔍 Enhanced Find Command - Smart search that automatically detects PID or port, shows full command line
- 📋 Automatic Port Sorting - Port listings are now automatically sorted by port number
- 🛑 Improved Shutdown UI - Better confirmation prompts and styled success/cancel messages
- 🏗️ Code Quality Improvements - Following Go best practices with comprehensive documentation
- 🧪 Enhanced Testing - Added test coverage for multiple packages including benchmarks
v1.2.1:
- 🎨 Custom Help Output Restored
- 🧹 Completion Command Cleanup
- 📁 Code Organization improvements
Shell completion is automatically installed when you use the install script or Homebrew.
Linux Installation (via install script):
# Install netmon (completions are automatically installed to system directories)
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash
# Completions are installed to system directories:
# - Bash: /etc/bash_completion.d or /usr/local/etc/bash_completion.d
# - Zsh: /usr/share/zsh/site-functions or /usr/local/share/zsh/site-functions
#
# Most Linux distributions work without additional configuration.
# Just restart your shell. If completion doesn't work:
# - Bash: Ensure bash-completion package is installed
# - Zsh: Ensure compinit is enabled in your ~/.zshrcmacOS Installation (via Homebrew):
# Homebrew automatically installs completions
brew install zzzzseong/netmon/netmon
# Add to ~/.zshrc (shown in installation caveats):
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
# Then restart your shell or run:
source ~/.zshrc📜 For detailed changelog and previous versions, see GitHub Releases
- Language: Go 1.25+
- Core Dependencies:
github.com/shirou/gopsutil/v3- System and process utilitiesgithub.com/charmbracelet/lipgloss- Terminal stylinggithub.com/manifoldco/promptui- Interactive prompts
- Routing System:
github.com/vishvananda/netlink- Linux netlink interfacegolang.org/x/net/route- BSD routing socket interfacegolang.org/x/sys/windows- Windows system calls
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: https://github.com/zzzzseong/netmon
- Issues: https://github.com/zzzzseong/netmon/issues
- Releases: https://github.com/zzzzseong/netmon/releases
Made with by zzzzseong
⭐ Star this repository if you find it helpful!