neulab/tldr huggingface dataset:
dsfield TOS the Type Of Service (TOS) key. This key has no associated mask and the longest match is understood as: First, compare the TOS of the route and of the packet. If they are not equal, then the packet may still match a route with a zero TOS.  TOS is either an 8 bit hexadecimal number or an identifier from /etc/iproute2/rt_dsfield.
metric NUMBER
preference NUMBER the preference value of the route.  NUMBER is an arbitrary 32bit number, where routes with lower values are preferred.
table TABLEID the table to add this route to.  TABLEID may be a number or a string from the file /etc/iproute2/rt_tables.  If this parameter is omitted, ip assumes the main table, with the exception of local, broadcast and nat routes, which are put into the local table by default.
vrf NAME the vrf name to add this route to. Implicitly means the table associated with the VRF.
dev NAME the output device name.
via [ FAMILY ] ADDRESS the address of the nexthop router, in the address family FAMILY.  Actually, the sense of this field depends on the route type.  For normal unicast routes it is either the true next hop router or, if it is a direct route installed in BSD compatibility mode, it can be a local address of the interface. For NAT routes it is the first address of the block of translated IP destinations.
src ADDRESS the source address to prefer when sending to the destinations covered by the route prefix.
realm REALMID the realm to which this route is assigned.  REALMID may be a number or a string from the file /etc/iproute2/rt_realms.
mtu MTU
mtu lock MTU the MTU along the path to the destination. If the modifier lock is not used, the MTU may be updated by the kernel due to Path MTU Discovery. If the modifier lock is used, no path MTU discovery will be tried, all packets will be sent without the DF bit in IPv4 case or fragmented to MTU for IPv6.
window NUMBER the maximal window for TCP to advertise to these destinations, measured in bytes. It limits maximal data bursts that our TCP peers are allowed to send to us.
rtt TIME the initial RTT ('Round Trip Time') estimate. If no suffix is specified the units are raw values passed directly to the routing code to maintain compatibility with previous releases.  Otherwise if a suffix of s, sec or secs is used to specify seconds and ms, msec or msecs to specify milliseconds.
rttvar TIME (Linux 2.3.15+ only) the initial RTT variance estimate. Values are specified as with rtt above.
rto_min TIME (Linux 2.6.23+ only) the minimum TCP Retransmission TimeOut to use when communicating with this destination. Values are specified as with rtt above.
ssthresh NUMBER (Linux 2.3.15+ only) an estimate for the initial slow start threshold.
cwnd NUMBER (Linux 2.3.15+ only) the clamp for congestion window. It is ignored if the lock flag is not used.
initcwnd NUMBER (Linux 2.5.70+ only) the initial congestion window size for connections to this destination.  Actual window size is this value multiplied by the MSS (``Maximal Segment Size'') for same connection. The default is zero, meaning to use the values specified in RFC2414.
initrwnd NUMBER (Linux 2.6.33+ only) the initial receive window size for connections to this destination.  Actual window size is this value multiplied by the MSS of the connection.  The default value is zero, meaning to use Slow Start value.
features FEATURES (Linux3.18+only) Enable or disable per-route features. Only available feature at this time is ecn to enable explicit congestion notification when initiating connections to the given destination network.  When responding to a connection request from the given network, ecn will also be used even if the net.ipv4.tcp_ecn sysctl is set to 0.
quickack BOOL (Linux 3.11+ only) Enable or disable quick ack for connections to this destination.
fastopen_no_cookie BOOL (Linux 4.15+ only) Enable TCP Fastopen without a cookie for connections to this destination.
congctl NAME (Linux 3.20+ only)
congctl lock NAME (Linux 3.20+ only) Sets a specific TCP congestion control algorithm only for a given destination.  If not specified, Linux keeps the current global default TCP congestion control algorithm, or the one set from the application. If the modifier lock is not used, an application may nevertheless overwrite the suggested congestion control algorithm for that destination. If the modifier lock is used, then an application is not allowed to overwrite the specified congestion control algorithm for that destination, thus it will be enforced/guaranteed to use the proposed algorithm.
advmss NUMBER (Linux 2.3.15+ only) the MSS ('Maximal Segment Size') to advertise to these destinations when establishing TCP connections. If it is not given, Linux uses a default value calculated from the first hop device MTU.  (If the path to these destination is asymmetric, this guess may be wrong.)
reordering NUMBER (Linux 2.3.15+ only) Maximal reordering on the path to this destination.  If it is not given, Linux uses the value selected with sysctl variable net/ipv4/tcp_reordering.
nexthop NEXTHOP the nexthop of a multipath route.  NEXTHOP is a complex value with its own syntax similar to the top level argument lists:
via [ FAMILY ] ADDRESS - is the nexthop router.
dev NAME - is the output device.
weight NUMBER - is a weight for this element of a multipath route reflecting its relative bandwidth or quality.
The internal buffer used in iproute2 limits the maximum number of nexthops that may be specified in one go. If only ADDRESS is given, the current buffer size allows for 144 IPv6 nexthops and 253 IPv4 ones. For IPv4, this effectively limits the number of nexthops possible per route. With IPv6, further nexthops may be appended to the same route via ip route append command.
scope SCOPE_VAL the scope of the destinations covered by the route prefix. SCOPE_VAL may be a number or a string from the file /etc/iproute2/rt_scopes.  If this parameter is omitted, ip assumes scope global for all gatewayed unicast routes, scope link for direct unicast and broadcast routes and scope host for local routes.
protocol RTPROTO the routing protocol identifier of this route.  RTPROTO may be a number or a string from the file /etc/iproute2/rt_protos.  If the routing protocol ID is not given, ip assumes protocol boot (i.e. it assumes the route was added by someone who doesn't understand what they are doing). Several protocol values have a fixed interpretation.  Namely:
redirect - the route was installed due to an ICMP redirect.
kernel - the route was installed by the kernel during autoconfiguration.
boot - the route was installed during the bootup sequence.  If a routing daemon starts, it will purge all of them.
static - the route was installed by the administrator to override dynamic routing. Routing daemon will respect them and, probably, even advertise them to its peers.
ra - the route was installed by Router Discovery protocol.
The rest of the values are not reserved and the administrator is free to assign (or not to assign) protocol tags.
onlink pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix.
pref PREF the IPv6 route preference.  PREF is a string specifying the route preference as defined in RFC4191 for Router Discovery messages. Namely:
low - the route has a lowest priority
medium - the route has a default priority
high - the route has a highest priority
nhid ID use nexthop object with given id as nexthop specification.
encap ENCAPTYPE ENCAPHDR attach tunnel encapsulation attributes to this route.
ENCAPTYPE is a string specifying the supported encapsulation type. Namely:
mpls - encapsulation type MPLS
ip - IP encapsulation (Geneve, GRE, VXLAN, ...)
bpf - Execution of BPF program
seg6 - encapsulation type IPv6 Segment Routing
seg6local - local SRv6 segment processing
ioam6 - encapsulation type IPv6 IOAM
ENCAPHDR is a set of encapsulation attributes specific to the ENCAPTYPE.
mpls MPLSLABEL - mpls label stack with labels separated by /
ttl TTL - TTL to use for MPLS header or 0 to inherit from IP header
ip id TUNNEL_ID dst REMOTE_IP [ src SRC ] [ tos TOS ] [ ttl TTL ] [ key ] [ csum ] [ seq ]
bpf in PROG - BPF program to execute for incoming packets
out PROG - BPF program to execute for outgoing packets
xmit PROG - BPF program to execute for transmitted packets
headroom SIZE - Size of header BPF program will attach (xmit)
seg6 mode inline - Directly insert Segment Routing Header after IPv6 header
mode encap - Encapsulate packet in an outer IPv6 header with SRH
mode l2encap - Encapsulate ingress L2 frame within an outer IPv6 header and SRH
SEGMENTS - List of comma-separated IPv6 addresses
KEYID - Numerical value in decimal representation. See ip-sr(8).
seg6local SEG6_ACTION [ SEG6_ACTION_PARAM ] [ count ] - Operation to perform on matching packets. The optional count attribute is used to collect statistics on the processing of actions.  Three counters are implemented: 1) packets correctly processed; 2) bytes correctly processed; 3) packets that cause a processing error (i.e., missing SID List, wrong SID List, etc). To retrieve the counters related to an action use the -s flag in the show command.  The following actions are currently supported (Linux 4.14+ only).
End - Regular SRv6 processing as intermediate segment endpoint.  This action only accepts packets with a non-zero Segments Left value. Other matching packets are dropped.
End.X nh6 NEXTHOP - Regular SRv6 processing as intermediate segment endpoint.  Additionally, forward processed packets to given next-hop. This action only accepts packets with a non- zero Segments Left value. Other matching packets are dropped.
End.DX6 nh6 NEXTHOP - Decapsulate inner IPv6 packet and forward it to the specified next- hop. If the argument is set to ::, then the next-hop is selected according to the local selection rules. This action only accepts packets with either a zero Segments Left value or no SRH at all, and an inner IPv6 packet. Other matching packets are dropped.
End.DT6 { table | vrftable } TABLEID - Decapsulate the inner IPv6 packet and forward it according to the specified lookup table. TABLEID is either a number or a string from the file /etc/iproute2/rt_tables.  If vrftable is used, the argument must be a VRF device associated with the table id. Moreover, the VRF table associated with the table id must be configured with the VRF strict mode turned on (net.vrf.strict_mode=1). This action only accepts packets with either a zero Segments Left value or no SRH at all, and an inner IPv6 packet. Other matching packets are dropped.
End.DT4 vrftable TABLEID - Decapsulate the inner IPv4 packet and forward it according to the specified lookup table.  TABLEID is either a number or a string from the file /etc/iproute2/rt_tables.  The argument must be a VRF device associated with the table id. Moreover, the VRF table associated with the table id must be configured with the VRF strict mode turned on (net.vrf.strict_mode=1). This action only accepts packets with either a zero Segments Left value or no SRH at all, and an inner IPv4 packet. Other matching packets are dropped.
End.DT46 vrftable TABLEID - Decapsulate the inner IPv4 or IPv6 packet and forward it according to the specified lookup table. TABLEID is either a number or a string from the file /etc/iproute2/rt_tables.  The argument must be a VRF device associated with the table id.  Moreover, the VRF table associated with the table id must be configured with the VRF strict mode turned on (net.vrf.strict_mode=1). This action only accepts packets with either a zero Segments Left value or no SRH at all, and an inner IPv4 or IPv6 packet. Other matching packets are dropped.
End.B6 srh segs SEGMENTS [ hmac KEYID ] - Insert the specified SRH immediately after the IPv6 header, update the DA with the first segment of the newly inserted SRH, then forward the resulting packet. The original SRH is not modified. This action only accepts packets with a non-zero Segments Left value. Other matching packets are dropped.
End.B6.Encaps srh segs SEGMENTS [ hmac KEYID ] - Regular SRv6 processing as intermediate segment endpoint.  Additionally, encapsulate the matching packet within an outer IPv6 header followed by the specified SRH. The destination address of the outer IPv6 header is set to the first segment of the new SRH. The source address is set as described in ip-sr(8).
ioam6 IOAM6_TRACE_TYPE - List of IOAM data required in the trace, represented by a bitfield (24 bits).
IOAM6_NAMESPACE - Numerical value to represent an IOAM namespace. See ip-ioam(8).
IOAM6_TRACE_SIZE - Size, in octets, of the pre- allocated trace data block.
expires TIME (Linux 4.4+ only) the route will be deleted after the expires time.  Only support IPv6 at present.
ttl-propagate { enabled | disabled } Control whether TTL should be propagated from any encap into the un-encapsulated packet, overriding any global configuration. Only supported for MPLS at present.
ip route delete delete route ip route del has the same arguments as ip route add, but their semantics are a bit different.
Key values (to, tos, preference and table) select the route to delete. If optional attributes are present, ip verifies that they coincide with the attributes of the route to delete.  If no route with the given key and attributes was found, ip route del fails.
ip route show list routes the command displays the contents of the routing tables or the route(s) selected by some criteria.
to SELECTOR (default) only select routes from the given range of destinations. SELECTOR consists of an optional modifier (root, match or exact) and a prefix.  root PREFIX selects routes with prefixes not shorter than PREFIX.  F.e.  root 0/0 selects the entire routing table.  match PREFIX selects routes with prefixes not longer than PREFIX.  F.e.  match 10.0/16 selects 10.0/16, 10/8 and 0/0, but it does not select 10.1/16 and 10.0.0/24.  And exact PREFIX (or just PREFIX) selects routes with this exact prefix. If neither of these options are present, ip assumes root 0/0 i.e. it lists the entire table.
dsfield TOS only select routes with the given TOS.
table TABLEID show the routes from this table(s). The default setting is to show table main.  TABLEID may either be the ID of a real table or one of the special values:
all - list all of the tables.
cache - dump the routing cache.
vrf NAME show the routes for the table associated with the vrf name
cached list cloned routes i.e. routes which were dynamically forked from other routes because some route attribute (f.e. MTU) was updated.  Actually, it is equivalent to table cache.
from SELECTOR the same syntax as for to, but it binds the source address range rather than destinations.  Note that the from option only works with cloned routes.
protocol RTPROTO only list routes of this protocol.
scope SCOPE_VAL only list routes with this scope.
type TYPE only list routes of this type.
dev NAME only list routes going via this device.
via [ FAMILY ] PREFIX only list routes going via the nexthop routers selected by PREFIX.
src PREFIX only list routes with preferred source addresses selected by PREFIX.
realm REALMID
realms FROMREALM/TOREALM only list routes with these realms.
ip route flush flush routing tables this command flushes routes selected by some criteria.
The arguments have the same syntax and semantics as the arguments of ip route show, but routing tables are not listed but purged. The only difference is the default action: show dumps all the IP main routing table but flush prints the helper page.
With the -statistics option, the command becomes verbose. It prints out the number of deleted routes and the number of rounds made to flush the routing table. If the option is given twice, ip route flush also dumps all the deleted routes in the format described in the previous subsection.
ip route get get a single route this command gets a single route to a destination and prints its contents exactly as the kernel sees it.
fibmatch Return full fib lookup matched route. Default is to return the resolved dst entry
to ADDRESS (default) the destination address.
from ADDRESS the source address.
dsfield TOS the Type Of Service.
iif NAME the device from which this packet is expected to arrive.
oif NAME force the output device on which this packet will be routed.
mark MARK the firewall mark (fwmark)
vrf NAME force the vrf device on which this packet will be routed.
ipproto PROTOCOL ip protocol as seen by the route lookup
sport NUMBER source port as seen by the route lookup
dport NUMBER destination port as seen by the route lookup
connected if no source address (option from) was given, relookup the route with the source set to the preferred address received from the first lookup.  If policy routing is used, it may be a different route.
Note that this operation is not equivalent to ip route show.  show shows existing routes.  get resolves them and creates new clones if necessary. Essentially, get is equivalent to sending a packet along this path.  If the iif argument is not given, the kernel creates a route to output packets towards the requested destination.  This is equivalent to pinging the destination with a subsequent ip route ls cache, however, no packets are actually sent. With the iif argument, the kernel pretends that a packet arrived from this interface and searches for a path to forward the packet.
ip route save save routing table information to stdout This command behaves like ip route show except that the output is raw data suitable for passing to ip route restore.
ip route restore restore routing table information from stdin This command expects to read a data stream as returned from ip route save.  It will attempt to restore the routing table information exactly as it was at the time of the save, so any translation of information in the stream (such as device indexes) must be done first. Any existing routes are left unchanged. Any routes specified in the data stream that already exist in the table will be ignored.
Starting with Linux kernel version 3.6, there is no routing cache for IPv4 anymore. Hence ip route show cached will never print any entries on systems with this or newer kernel versions.
ip ro Show all route entries in the kernel.
ip route add default via 192.168.1.1 dev eth0 Adds a default route (for all addresses) via the local gateway 192.168.1.1 that can be reached on device eth0.
ip route add 10.1.1.0/30 encap mpls 200/300 via 10.1.1.1 dev eth0 Adds an ipv4 route with mpls encapsulation attributes attached to it.
ip -6 route add 2001:db8:1::/64 encap seg6 mode encap segs 2001:db8:42::1,2001:db8:ffff::2 dev eth0 Adds an IPv6 route with SRv6 encapsulation and two segments attached.
ip -6 route add 2001:db8:1::/64 encap seg6local action End.DT46 vrftable 100 dev vrf100 Adds an IPv6 route with SRv6 decapsulation and forward with lookup in VRF table.
ip -6 route add 2001:db8:1::/64 encap ioam6 trace prealloc type 0x800000 ns 1 size 12 dev eth0 Adds an IPv6 route with an IOAM Pre-allocated Trace encapsulation that only includes the hop limit and the node id, configured for the IOAM namespace 1 and a pre-allocated data block of 12 octets.
ip route add 10.1.1.0/30 nhid 10 Adds an ipv4 route using nexthop object with id 10.
MAN(1)                     BSD General Commands Manual                    MAN(1)
man — display manual pages
man [-acfhklw] [-C file] [-M path] [-m path] [-S subsection] [[-s] section] name ...
The man utility displays the manual page entitled name.  Pages may be selected according to a specific category (section) or machine architecture (subsection).
-a      Display all matching manual pages.
-C file Use the specified file instead of the default configuration file. This permits users to configure their own manual environment.  See man.conf(5) for a description of the contents of this file.
-c      Copy the manual page to the standard output instead of using less(1) to paginate it.  This is done by default if the standard output is not a terminal device.
When using -c, most terminal devices are unable to show the markup. To print the output of man to the terminal with markup but without using a pager, pipe it to ul(1).  To remove the markup, pipe the output to col(1) -b instead.
-f      A synonym for whatis(1).  It searches for name in manual page names and displays the header lines from all matching pages.  The search is case insensitive and matches whole words only.
-h      Display only the SYNOPSIS lines of the requested manual pages. Implies -a and -c.
-k      A synonym for apropos(1).  Instead of name, an expression can be provided using the syntax described in the apropos(1) manual.  By default, it displays the header lines of all matching pages.
-l      A synonym for mandoc(1).  The name arguments are interpreted as filenames.  No search is done and file, path, section, subsection, and -w are ignored.  This option implies -a.
-M path Override the list of directories to search for manual pages.  The supplied path must be a colon (‘:’) separated list of directories. This option also overrides the environment variable MANPATH and any directories specified in the man.conf(5) file.
-m path Augment the list of directories to search for manual pages.  The supplied path must be a colon (‘:’) separated list of directories. These directories will be searched before those specified using the -M option, the MANPATH environment variable, the man.conf(5) file, or the default directories.
-S subsection Only show pages for the specified machine(1) architecture. subsection is case insensitive.
By default manual pages for all architectures are installed. Therefore this option can be used to view pages for one architecture whilst using another.
This option overrides the MACHINE environment variable.
[-s] section Only select manuals from the specified section.  The currently available sections are:
1         General commands (tools and utilities). 2         System calls and error numbers. 3         Library functions. 3p        perl(1) programmer's reference guide. 4         Device drivers. 5         File formats. 6         Games. 7         Miscellaneous information. 8         System maintenance and operation commands. 9         Kernel internals.
-w      List the pathnames of all matching manual pages instead of displaying any of them.  If no name is given, list the directories that would be searched.
The options -IKOTW are also supported and are documented in mandoc(1).  The options -fkl are mutually exclusive and override each other.
The search starts with the -m argument if provided, then continues with the -M argument, the MANPATH variable, the manpath entries in the man.conf(5) file, or with /usr/share/man:/usr/X11R6/man:/usr/local/man by default. Within each of these, directories are searched in the order provided. Within each directory, the search proceeds according to the following list of sections: 1, 8, 6, 2, 3, 5, 7, 4, 9, 3p.  The first match found is shown.
The mandoc.db(5) database is used for looking up manual page entries.  In cases where the database is absent, outdated, or corrupt, man falls back to looking for files called name.section.  If both a formatted and an unformatted version of the same manual page, for example cat1/foo.0 and man1/foo.1, exist in the same directory, only the unformatted version is used.  The database is kept up to date with makewhatis(8), which is run by the weekly(8) maintenance script.
Guidelines for writing man pages can be found in mdoc(7).
MACHINE   As some manual pages are intended only for specific architectures, man searches any subdirectories, with the same name as the current architecture, in every directory which it searches.  Machine specific areas are checked before general areas.  The current machine type may be overridden by setting the environment variable MACHINE to the name of a specific architecture, or with the -S option.  MACHINE is case insensitive.
MANPAGER  Any non-empty value of the environment variable MANPAGER is used instead of the standard pagination program, less(1).  If less(1) is used, the interactive :t command can be used to go to the definitions of various terms, for example command line options, command modifiers, internal commands, environment variables, function names, preprocessor macros, errno(2) values, and some other emphasized words.  Some terms may have defining text at more than one place.  In that case, the less(1) interactive commands t and T can be used to move to the next and to the previous place providing information about the term last searched for with :t.  The -O tag[=term] option documented in the mandoc(1) manual opens a manual page at the definition of a specific term rather than at the beginning.
MANPATH   Override the standard search path which is either specified in man.conf(5) or the default path.  The format of MANPATH is a colon (‘:’) separated list of directories.  Invalid directories are ignored.  Overridden by -M, ignored if -l is specified.
If MANPATH begins with a colon, it is appended to the standard path; if it ends with a colon, it is prepended to the standard path; or if it contains two adjacent colons, the standard path is inserted between the colons.
PAGER     Specifies the pagination program to use when MANPAGER is not defined.  If neither PAGER nor MANPAGER is defined, less(1) is used.
/etc/man.conf  default man configuration file
The man utility exits 0 on success, and >0 if an error occurs.  See mandoc(1) for details.
Format a page for pasting extracts into an email message — avoid printing any UTF-8 characters, reduce the width to ease quoting in replies, and remove markup:
$ man -T ascii -O width=65 pledge | col -b
Read a typeset page in a PDF viewer:
$ MANPAGER=mupdf man -T pdf lpd
apropos(1), col(1), mandoc(1), ul(1), whereis(1), man.conf(5), mdoc(7)
The man utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
The flags [-aCcfhIKlMmOSsTWw], as well as the environment variables MACHINE, MANPAGER, and MANPATH, are extensions to that specification.
A man command first appeared in Version 2 AT&T UNIX.
The -w option first appeared in Version 7 AT&T UNIX; -f and -k in 4BSD; -M in 4.3BSD; -a in 4.3BSD-Tahoe; -c and -m in 4.3BSD-Reno; -h in 4.3BSD Net/2; -C in NetBSD 1.0; -s and -S in OpenBSD 2.3; and -I, -K, -l, -O, and -W in OpenBSD 5.7.  The -T option first appeared in AT&T System III UNIX and was also added in OpenBSD 5.7.
docker-inspect - Return low-level information on Docker objects
docker inspect [OPTIONS] NAME|ID [NAME|ID...]
This displays the low-level information on Docker object(s) (e.g. container, image, volume,network, node, service, or task) identified by name or ID. By default, this will render all results in a JSON array. If the container and image have the same name, this will return container JSON for unspecified type. If a format is specified, the given template will be executed for each result.
Get information about an image when image name conflicts with the container name, e.g. both image and container are named rhel7:
$ docker inspect --type=image rhel7 [ { "Id": "fe01a428b9d9de35d29531e9994157978e8c48fa693e1bf1d221dffbbb67b170", "Parent": "10acc31def5d6f249b548e01e8ffbaccfd61af0240c17315a7ad393d022c5ca2", .... } ]
Getting information on a container To get information on a container use its ID or instance name:
$ docker inspect d2cc496561d6 [{ "Id": "d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", "Created": "2015-06-08T16:18:02.505155285Z", "Path": "bash", "Args": [], "State": { "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 0, "Error": "", "StartedAt": "2015-06-08T16:18:03.643865954Z", "FinishedAt": "2015-06-08T16:57:06.448552862Z" }, "Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", "NetworkSettings": { "Bridge": "", "SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "/var/run/docker/netns/6b4851d1903e", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "MacAddress": "02:42:ac:12:00:02", "Networks": { "bridge": { "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", "Gateway": "172.17.0.1", "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "02:42:ac:12:00:02" } }
}, "ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf", "HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname", "HostsPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts", "LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log", "Name": "/adoring_wozniak", "RestartCount": 0, "Driver": "devicemapper", "MountLabel": "", "ProcessLabel": "", "Mounts": [ { "Source": "/data", "Destination": "/data", "Mode": "ro,Z", "RW": false "Propagation": "" } ], "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": null, "ContainerIDFile": "", "Memory": 0, "MemorySwap": 0, "CpuShares": 0, "CpuPeriod": 0, "CpusetCpus": "", "CpusetMems": "", "CpuQuota": 0, "BlkioWeight": 0, "OomKillDisable": false, "Privileged": false, "PortBindings": {}, "Links": null, "PublishAllPorts": false, "Dns": null, "DnsSearch": null, "DnsOptions": null, "ExtraHosts": null, "VolumesFrom": null, "Devices": [], "NetworkMode": "bridge", "IpcMode": "", "PidMode": "", "UTSMode": "", "CapAdd": null, "CapDrop": null, "RestartPolicy": { "Name": "no", "MaximumRetryCount": 0 }, "SecurityOpt": null, "ReadonlyRootfs": false, "Ulimits": null, "LogConfig": { "Type": "json-file", "Config": {} }, "CgroupParent": "" }, "GraphDriver": { "Name": "devicemapper", "Data": { "DeviceId": "5", "DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", "DeviceSize": "171798691840" } }, "Config": { "Hostname": "d2cc496561d6", "Domainname": "", "User": "", "AttachStdin": true, "AttachStdout": true, "AttachStderr": true, "ExposedPorts": null, "Tty": true, "OpenStdin": true, "StdinOnce": true, "Env": null, "Cmd": [ "bash" ], "Image": "fedora", "Volumes": null, "VolumeDriver": "", "WorkingDir": "", "Entrypoint": null, "NetworkDisabled": false, "MacAddress": "", "OnBuild": null, "Labels": {}, "Memory": 0, "MemorySwap": 0, "CpuShares": 0, "Cpuset": "", "StopSignal": "SIGTERM" } } ]
Getting the IP address of a container instance To get the IP address of a container use:
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d2cc496561d6 172.17.0.2
Listing all port bindings One can loop over arrays and maps in the results to produce simple text output:
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} \ {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d2cc496561d6 80/tcp -> 80
You can get more information about how to write a Go template from: https://golang.org/pkg/text/template/.
Getting size information on a container $ docker inspect -s d2cc496561d6 [ { "SizeRw": 0, "SizeRootFs": 972, } ]
Getting information on an image Use an image's ID or name (e.g., repository/name[:tag]) to get information about the image:
$ docker inspect ded7cd95e059 [{ "Id": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", "Parent": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", "Comment": "", "Created": "2015-05-27T16:58:22.937503085Z", "Container": "76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b", "ContainerConfig": { "Hostname": "76cf7f67d83a", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": null, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": null, "Cmd": [ "/bin/sh", "-c", "#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 in /" ], "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", "Volumes": null, "VolumeDriver": "", "WorkingDir": "", "Entrypoint": null, "NetworkDisabled": false, "MacAddress": "", "OnBuild": null, "Labels": {} }, "DockerVersion": "1.6.0", "Author": "Lokesh Mandvekar \u003clsm5@fedoraproject.org\u003e", "Config": { "Hostname": "76cf7f67d83a", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": null, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": null, "Cmd": null, "Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731", "Volumes": null, "VolumeDriver": "", "WorkingDir": "", "Entrypoint": null, "NetworkDisabled": false, "MacAddress": "", "OnBuild": null, "Labels": {} }, "Architecture": "amd64", "Os": "linux", "Size": 186507296, "VirtualSize": 186507296, "GraphDriver": { "Name": "devicemapper", "Data": { "DeviceId": "3", "DeviceName": "docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", "DeviceSize": "171798691840" } } } ]
-f, --format=""      Format the output using the given Go template
-h, --help[=false]      help for inspect
-s, --size[=false]      Display total file sizes if the type is container
--type=""      Return JSON for specified type
SAR(1)                         Linux User's Manual                        SAR(1)
sar - Collect, report, or save system activity information.
sar [ -A ] [ -B ] [ -b ] [ -C ] [ -D ] [ -d ] [ -F [ MOUNT ] ] [ -H ] [ -h ] [ -p ] [ -r [ ALL ] ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [ -W ] [ -w ] [ -y ] [ -z ] [ --dec={ 0 | 1 | 2 } ] [ --dev=dev_list ] [ --fs=fs_list ] [ --help ] [ --human ] [ --iface=iface_list ] [ --pretty ] [ --sadc ] [ -I { int_list | SUM | ALL } ] [ -P { cpu_list | ALL } ] [ -m { keyword[,...] | ALL } ] [ -n { keyword[,...] | ALL } ] [ -q [ keyword[,...] | ALL ] ] [ -j { SID | ID | LABEL | PATH | UUID | ... } ] [ -f [ filename ] | -o [ filename ] | -[0-9]+ ] [ -i interval ] [ -s [ hh:mm[:ss] ] ] [ -e [ hh:mm[:ss] ] ] [ interval [ count ] ]
The sar command writes to standard output the contents of selected cumulative activity counters in the operating system. The accounting system, based on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds.  If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously.  The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file (see below).  By default all the data available from the kernel are saved in the data file.
The sar command extracts and writes to standard output records previously saved in a file. This file can be either the one specified by the -f flag or, by default, the standard system activity daily data file.  It is also possible to enter -1, -2 etc. as an argument to sar to display data of that days ago. For example, -1 will point at the standard system activity file of yesterday.
Standard system activity daily data files are named saDD or saYYYYMMDD, where YYYY stands for the current year, MM for the current month and DD for the current day. They are the default files used by sar only when no filename has been explicitly specified.  When used to write data to files (with its option -o), sar will use saYYYYMMDD if option -D has also been specified, else it will use saDD.  When used to display the records previously saved in a file, sar will look for the most recent of saDD and saYYYYMMDD, and use it.
Standard system activity daily data files are located in the /var/log/sa directory by default. Yet it is possible to specify an alternate location for them: If a directory (instead of a plain file) is used with options -f or -o then it will be considered as the directory containing the data files.
Without the -P flag, the sar command reports system-wide (global among all processors) statistics, which are calculated as averages for values expressed as percentages, and as sums otherwise. If the -P flag is given, the sar command reports activity which relates to the specified processor or processors. If -P ALL is given, the sar command reports statistics for each individual processor and global statistics among all processors. Offline processors are not displayed.
You can select information about specific system activities using flags. Not specifying any flags selects only CPU activity.  Specifying the -A flag selects all possible activities.
The default version of the sar command (CPU utilization report) might be one of the first facilities the user runs to begin system activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound.
If multiple samples and multiple reports are desired, it is convenient to specify an output file for the sar command. Run the sar command as a background process. The syntax for this is:
sar -o datafile interval count >/dev/null 2>&1 &
All data are captured in binary form and saved to a file (datafile).  The data can then be selectively displayed with the sar command using the -f option. Set the interval and count parameters to select count records at interval second intervals. If the count parameter is not set, all the records saved in the file will be selected.  Collection of data in this manner is useful to characterize system usage over a period of time and determine peak usage hours.
Note: The sar command only reports on local activities.
-A     This is equivalent to specifying -bBdFHSvwWy -I SUM -m ALL -n ALL -q ALL -r ALL -u ALL.  This option also implies specifying -I ALL -P ALL unless these options are explicitly set on the command line.
-B     Report paging statistics.  The following values are displayed:
pgpgin/s Total number of kilobytes the system paged in from disk per second.
pgpgout/s Total number of kilobytes the system paged out to disk per second.
fault/s Number of page faults (major + minor) made by the system per second.  This is not a count of page faults that generate I/O, because some page faults can be resolved without I/O.
majflt/s Number of major faults the system has made per second, those which have required loading a memory page from disk.
pgfree/s Number of pages placed on the free list by the system per second.
pgscank/s Number of pages scanned by the kswapd daemon per second.
pgscand/s Number of pages scanned directly per second.
pgsteal/s Number of pages the system has reclaimed from cache (pagecache and swapcache) per second to satisfy its memory demands.
%vmeff Calculated as pgsteal / pgscan, this is a metric of the efficiency of page reclaim. If it is near 100% then almost every page coming off the tail of the inactive list is being reaped. If it gets too low (e.g. less than 30%) then the virtual memory is having some difficulty.  This field is displayed as zero if no pages have been scanned during the interval of time.
-b     Report I/O and transfer rate statistics. The following values are displayed:
tps    Total number of transfers per second that were issued to physical devices.  A transfer is an I/O request to a physical device. Multiple logical requests can be combined into a single I/O request to the device.  A transfer is of indeterminate size.
rtps   Total number of read requests per second issued to physical devices.
wtps   Total number of write requests per second issued to physical devices.
dtps   Total number of discard requests per second issued to physical devices.
bread/s Total amount of data read from the devices in blocks per second.  Blocks are equivalent to sectors and therefore have a size of 512 bytes.
bwrtn/s Total amount of data written to devices in blocks per second.
bdscd/s Total amount of data discarded for devices in blocks per second.
-C     When reading data from a file, tell sar to display comments that have been inserted by sadc.
-D     Use saYYYYMMDD instead of saDD as the standard system activity daily data file name. This option works only when used in conjunction with option -o to save data to file.
-d     Report activity for each block device.  When data are displayed, the device name is displayed as it (should) appear in /dev.  sar uses data in /sys to determine the device name based on its major and minor numbers.  If this name resolution fails, sar will use name mapping controlled by /etc/conf.d/sysstat.ioconf file. Persistent device names can also be printed if option -j is used (see below). Statistics for all devices are displayed unless a restricted list is specified using option --dev= (see corresponding option entry).  Note that disk activity depends on sadc's options -S DISK and -S XDISK to be collected. The following values are displayed:
rkB/s  Number of kilobytes read from the device per second.
wkB/s  Number of kilobytes written to the device per second.
dkB/s  Number of kilobytes discarded for the device per second.
areq-sz The average size (in kilobytes) of the I/O requests that were issued to the device. Note: In previous versions, this field was known as avgrq- sz and was expressed in sectors.
aqu-sz The average queue length of the requests that were issued to the device. Note: In previous versions, this field was known as avgqu- sz.
await  The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
%util  Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.
--dev=dev_list Specify the block devices for which statistics are to be displayed by sar.  dev_list is a list of comma-separated device names.
-e [ hh:mm[:ss] ] Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format.  This option can be used when data are read from or written to a file (options -f or -o).
-F [ MOUNT ] Display statistics for currently mounted filesystems. Pseudo- filesystems are ignored. At the end of the report, sar will display a summary of all those filesystems. Use of the MOUNT parameter keyword indicates that mountpoint will be reported instead of filesystem device. Statistics for all filesystems are displayed unless a restricted list is specified using option --fs= (see corresponding option entry).  Note that filesystems statistics depend on sadc's option -S XDISK to be collected.
The following values are displayed:
MBfsfree Total amount of free space in megabytes (including space available only to privileged user).
MBfsused Total amount of space used in megabytes.
%fsused Percentage of filesystem space used, as seen by a privileged user.
%ufsused Percentage of filesystem space used, as seen by an unprivileged user.
Ifree  Total number of free file nodes in filesystem.
Iused  Total number of file nodes used in filesystem.
%Iused Percentage of file nodes used in filesystem.
-f [ filename ] Extract records from filename (created by the -o filename flag). The default value of the filename parameter is the current standard system activity daily data file. If filename is a directory instead of a plain file then it is considered as the directory where the standard system activity daily data files are located. Option -f is exclusive of option -o.
--fs=fs_list Specify the filesystems for which statistics are to be displayed by sar.  fs_list is a list of comma-separated filesystem names or mountpoints.
-H     Report hugepages utilization statistics.  The following values are displayed:
kbhugfree Amount of hugepages memory in kilobytes that is not yet allocated.
kbhugused Amount of hugepages memory in kilobytes that has been allocated.
%hugused Percentage of total hugepages memory that has been allocated.
kbhugrsvd Amount of reserved hugepages memory in kilobytes.
kbhugsurp Amount of surplus hugepages memory in kilobytes.
-h     This option is equivalent to specifying --pretty --human.
--help Display a short help message then exit.
-I { int_list | SUM | ALL } Report statistics for interrupts.  int_list is a list of comma- separated values or range of values (e.g., 0-16,35,400-). The SUM keyword indicates that the total number of interrupts received per second is to be displayed. The ALL keyword indicates that statistics from all interrupts, including potential APIC interrupt sources, are to be reported.  Note that interrupt statistics depend on sadc's option -S INT to be collected.
-i interval Select data records at seconds as close as possible to the number specified by the interval parameter.
--iface=iface_list Specify the network interfaces for which statistics are to be displayed by sar.  iface_list is a list of comma-separated interface names.
-j { SID | ID | LABEL | PATH | UUID | ... } Display persistent device names. Use this option in conjunction with option -d. Keywords ID, LABEL, etc. specify the type of the persistent name. These keywords are not limited, only prerequisite is that directory with required persistent names is present in /dev/disk.  Keyword SID tries to get a stable identifier to use as the device name. A stable identifier won't change across reboots for the same physical device. If it exists, this identifier is normally the WWN (World Wide Name) of the device, as read from the /dev/disk/by-id directory.
-m { keyword[,...] | ALL } Report power management statistics.  Note that these statistics depend on sadc's option -S POWER to be collected.
Possible keywords are CPU, FAN, FREQ, IN, TEMP and USB.
With the CPU keyword, statistics about CPU are reported.  The following value is displayed:
MHz    Instantaneous CPU clock frequency in MHz.
With the FAN keyword, statistics about fans speed are reported. The following values are displayed:
rpm    Fan speed expressed in revolutions per minute.
drpm   This field is calculated as the difference between current fan speed (rpm) and its low limit (fan_min).
DEVICE Sensor device name.
With the FREQ keyword, statistics about CPU clock frequency are reported.  The following value is displayed:
wghMHz Weighted average CPU clock frequency in MHz.  Note that the cpufreq-stats driver must be compiled in the kernel for this option to work.
With the IN keyword, statistics about voltage inputs are reported. The following values are displayed:
inV    Voltage input expressed in Volts.
%in    Relative input value. A value of 100% means that voltage input has reached its high limit (in_max) whereas a value of 0% means that it has reached its low limit (in_min).
With the TEMP keyword, statistics about devices temperature are reported.  The following values are displayed:
degC   Device temperature expressed in degrees Celsius.
%temp  Relative device temperature. A value of 100% means that temperature has reached its high limit (temp_max).
With the USB keyword, the sar command takes a snapshot of all the USB devices currently plugged into the system. At the end of the report, sar will display a summary of all those USB devices.  The following values are displayed:
BUS    Root hub number of the USB device.
idvendor Vendor ID number (assigned by USB organization).
idprod Product ID number (assigned by Manufacturer).
maxpower Maximum power consumption of the device (expressed in mA).
manufact Manufacturer name.
product Product name.
The ALL keyword is equivalent to specifying all the keywords above and therefore all the power management statistics are reported.
-n { keyword[,...] | ALL } Report network statistics.
Possible keywords are DEV, EDEV, FC, ICMP, EICMP, ICMP6, EICMP6, IP, EIP, IP6, EIP6, NFS, NFSD, SOCK, SOCK6, SOFT, TCP, ETCP, UDP and UDP6.
With the DEV keyword, statistics from the network devices are reported.  Statistics for all network interfaces are displayed unless a restricted list is specified using option --iface= (see corresponding option entry).  The following values are displayed:
IFACE  Name of the network interface for which statistics are reported.
rxpck/s Total number of packets received per second.