The generic form of an ip
command is:
ip [ OPTIONS ] OBJECT [ COMMAND [ ARGUMENTS ]]where
OPTIONS
is a set of optional modifiers affecting the
general behaviour of the ip
utility or changing its output. All options
begin with the character '-'
and may be used in either long or abbreviated
forms. Currently, the following options are available:
-V
, -Version
-- print the version of the ip
utility and exit.
-s
, -stats
, -statistics
-- output more information. If the option appears twice or more, the amount of information increases. As a rule, the information is statistics or some time values.
-d
, -details
-- output more detailed information.
-f
, -family
followed by a protocol family
identifier: inet
, inet6
or link
.
-- enforce the protocol family to use. If the option is not present,
the protocol family is guessed from other arguments. If the rest of the command
line does not give enough information to guess the family, ip
falls back to the default
one, usually inet
or any
. link
is a special family
identifier meaning that no networking protocol is involved.
-4
-- shortcut for -family inet
.
-6
-- shortcut for -family inet6
.
-0
-- shortcut for -family link
.
-o
, -oneline
-- output each record on a single line, replacing line feeds
with the '\'
character. This is convenient when you want to
count records with wc
or to grep
the output. The trivial
script rtpr
converts the output back into readable form.
-r
, -resolve
-- use the system's name resolver to print DNS names instead of host addresses.
1cm NB. Do not use this option when reporting bugs or asking for advice.
1cm NB.
ip
never uses DNS to resolve names to addresses.
-b
, -batch FILE
-- read commands from provided file or standart input and invoke them.
First failure will cause termination of ip
.
In batch FILE
everything which begins with #
symbol is
ignored and can be used for comments.