1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

netstat: Add the wide flag option

Previously netstat would print the whole line of an ip address or
resolved hostname. If the hostname was longer than the address column
length, it would push following columns into disaligned output.

This sets the default behavior to truncate any IP address or symbolic
hostname that is larger than the maximum address column size to provide
cleaner output. In the event the user wishes to see the whole address
name, they can then pass the wide option that will output as wide as
necessary to print the whole name.
This commit is contained in:
brapru 2022-04-16 16:18:13 -04:00 committed by Andreas Kling
parent 07c2c86314
commit a7bb3fe7a8
2 changed files with 22 additions and 9 deletions

View file

@ -5,7 +5,7 @@ netstat
## Synopsis
```sh
$ netstat [--all] [--list] [--tcp] [--udp] [--numeric] [--program]
$ netstat [--all] [--list] [--tcp] [--udp] [--numeric] [--program] [--wide]
```
## Description
@ -20,5 +20,6 @@ Display network connections
* `-u`, `--udp`: Display only UDP network connections
* `-n`, `--numeric`: Display numerical addresses
* `-p`, `--program`: Show the PID and name of the program to which each socket belongs
* `-W`, `--wide`: Do not truncate IP addresses by printing out the whole symbolic host
<!-- Auto-generated through ArgsParser -->