IFDATA(1) moreutils IFDATA(1)

.SH "NAME" ifdata - get network interface info without parsing ifconfig output

.SH "SYNOPSIS"

.HP 168u

**ifdata** \[options] {*iface*}

.SH "DESCRIPTION"

.PP **ifdata** can be used to check for the existence of a network interface, or to get information about the interface, such as its IP address. Unlike **ifconfig** or **ip**, **ifdata** has simple to parse output that is designed to be easily used by a shell script.

.SH "OPTIONS"

.PP **-h**

Print out a help summary.

.RE .PP **-e**

Test to see if the interface exists, exit nonzero if it does not.

.RE .PP **-p**

Prints out the whole configuration of the interface.

.RE .PP **-pe**

Prints "yes" or "no" if the interface exists or not.

.RE .PP **-pa**

Prints the IPv4 address of the interface.

.RE .PP **-pn**

Prints the netmask of the interface.

.RE .PP **-pN**

Prints the network address of the interface.

.RE .PP **-pb**

Prints the broadcast address of the interface.

.RE .PP **-pm**

Prints the MTU of the interface.

.RE

.PP Following options are Linux only.

.PP **-ph**

Prints the hardware address of the interface. Exit with a failure exit code if there is not hardware address for the given network interface.

.RE

.PP **-pf**

Prints the flags of the interface.

.RE .PP **-si**

Prints out all the input statistics of the interface.

.RE .PP **-sip**

Prints the number of input packets.

.RE .PP **-sib**

Prints the number of input bytes.

.RE .PP **-sie**

Prints the number of input errors.

.RE .PP **-sid**

Prints the number of dropped input packets.

.RE .PP **-sif**

Prints the number of input fifo overruns.

.RE

.PP **-sic**

Print the number of compressed input packets.

.RE .PP **-sim**

Prints the number of input multicast packets.

.RE

.PP **-so**

Prints out all the output statistics of the interface.

.RE .PP **-sop**

Prints the number of output packets.

.RE .PP **-sob**

Prints the number of output bytes.

.RE .PP **-soe**

Prints the number of output errors.

.RE .PP **-sod**

Prints the number of dropped output packets.

.RE .PP **-sof**

Prints the number of output fifo overruns.

.RE

.PP **-sox**

Print the number of output collisions.

.RE .PP **-soc**

Prints the number of output carrier losses.

.RE .PP **-som**

Prints the number of output multicast packets.

.RE .PP **-bips**

Prints the number of bytes of incoming traffic measured in one second.

.RE .PP **-bops**

Prints the number of bytes of outgoing traffic measured in one second.

.RE

.SH "AUTHOR"

.PP Benjamin BAYART

2006-03-07 moreutils

---

Document: ifdata(1) from moreutils 0.70-r2 (Chainguard OS)
Source: git://git.joeyh.name/moreutils
