lnstat Command Examples in Linux

lnstat command is offered by the iproute2 package. It provides unified Linux network statistics.

lnstat Command Examples

1. To get the unified network statistics:

# lnstat 

2. To print the number of intervals:

# lnstat -c 10  

3. To dump list of available files/keys:

# lnstat -d 
# lnstat --dump 

4. To get the stats file to use:

# lnstat -f file.txt
# lnstat --file file.txt 

5. To set the interval to specified seconds:

# lnstat -i 10
# lnstat --interval 10 

6. To display only the specified keys:

# lnstat -k k,k,k
# lnstat --keys k,k,k 

For example:

# lnstat -k arp_cache:entries,rt_cache:in_hit,arp_cache:destroys

7. To specify the header printing:

# lnstat -s 0  (No header at all)
# lnstat -s 1  (Prints a header only  at  start)
# lnstat -s 2  (prints a header every 20 lines) 

8. To specify the width for every field:

# lnstat -w 1,2,3,
# lnstat --width 2,2,2 

9. To get the help for lnstat:

# lnstat --help 

10. To get the version info:

# lnstat --version 
Related Post