1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Copyright 2006 Joey Hess
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook V4.4//EN"
24 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
31 <firstname>Joey
</firstname>
32 <surname>Hess
</surname>
34 <date>2006-
03-
07</date>
38 <refentrytitle>ifdata
</refentrytitle>
39 <manvolnum>1</manvolnum>
40 <refmiscinfo class=
"manual">moreutils
</refmiscinfo>
41 <refmiscinfo class=
"source">moreutils
</refmiscinfo>
45 <refname>ifdata
</refname>
46 <refpurpose>get network interface info without
47 parsing ifconfig output
</refpurpose>
52 <command>ifdata
</command>
54 <arg choice=
"req"><replaceable>iface
</replaceable></arg>
59 <title>DESCRIPTION
</title>
62 <command>ifdata
</command> can be used to check for
63 the existence of a network interface, or to get
64 information abut the interface, such as its IP
65 address. Unlike
<command>ifconfig
</command> or
66 <command>ip
</command>,
<command>ifdata
</command>
67 has simple to parse output that is designed to be
68 easily used by a shell script.
74 <title>OPTIONS
</title>
79 <term><option>-h
</option></term>
81 <para>Print out a help summary.
</para>
86 <term><option>-e
</option></term>
88 <para>Test to see if the interface exists,
89 exit nonzero if it does not.
</para>
94 <term><option>-p
</option></term>
96 <para>Prints out the whole configuration of
102 <term><option>-pe
</option></term>
104 <para>Prints
"yes" or
"no" if the interface
105 exists or not.
</para>
110 <term><option>-pa
</option></term>
112 <para>Prints the IPv4 address of the
118 <term><option>-pn
</option></term>
120 <para>Prints the netmask of the
126 <term><option>-pN
</option></term>
128 <para>Prints the network address of the
134 <term><option>-pb
</option></term>
136 <para>Prints the broadcast address of the
142 <term><option>-pm
</option></term>
144 <para>Prints the MTU of the interface.
</para>
150 <para>Following options are Linux only.
</para>
155 <term><option>-ph
</option></term>
157 <para>Prints the hardware address of the
163 <term><option>-pf
</option></term>
165 <para>Prints the flags of the
171 <term><option>-si
</option></term>
173 <para>Prints out all the input statistics
174 of the interface.
</para>
179 <term><option>-sip
</option></term>
181 <para>Prints the number of input packets.
</para>
186 <term><option>-sib
</option></term>
188 <para>Prints the number of input bytes.
</para>
193 <term><option>-sie
</option></term>
195 <para>Prints the number of input errors.
</para>
200 <term><option>-sid
</option></term>
202 <para>Prints the number of dropped input
208 <term><option>-sif
</option></term>
210 <para>Prints the number of input fifo overruns.
</para>
215 <term><option>-sic
</option></term>
217 <para>Print the number of compressed input
223 <term><option>-sim
</option></term>
225 <para>Prints the number of input
226 multicast packets.
</para>
231 <term><option>-so
</option></term>
233 <para>Prints out all the output statistics
234 of the interface.
</para>
239 <term><option>-sop
</option></term>
241 <para>Prints the number of output packets.
</para>
246 <term><option>-sob
</option></term>
248 <para>Prints the number of output bytes.
</para>
253 <term><option>-soe
</option></term>
255 <para>Prints the number of output errors.
</para>
260 <term><option>-sod
</option></term>
262 <para>Prints the number of dropped
263 output packets.
</para>
268 <term><option>-sof
</option></term>
270 <para>Prints the number of output fifo overruns.
</para>
275 <term><option>-sox
</option></term>
277 <para>Print the number of output collisions.
</para>
282 <term><option>-soc
</option></term>
284 <para>Prints the number of output carrier
290 <term><option>-som
</option></term>
292 <para>Prints the number of output multicast
298 <term><option>-bips
</option></term>
300 <para>Prints the number of bytes of
301 incoming traffic measured in one second.
</para>
306 <term><option>-bops
</option></term>
308 <para>Prints the number of bytes of
309 outgoing traffic measured in one second.
</para>
317 <title>AUTHOR
</title>