Skip to contentSkip to conversation

Adding examples in ip man page on basic use of the ip command.

PATCH In review Alex Juncu 3 participants 3 messages Nov 24, 2011 – Nov 29, 2011

Subsystems (2)
lore
Share & tools
lore

Alex Juncu

author
#0 lore raw

PATCH 1/1 Adding examples in ip man page on basic use of the ip command.

---
 man/man8/ip.8 |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)
man/man8/ip.8 +43 -0
index a20eca7..99c8953 100644
@@ -2855,6 +2855,49 @@ can be
 .SS ip xfrm monitor - state monitoring for xfrm objects
 The xfrm objects to monitor can be optionally specified.
 
+.SH EXAMPLES
+.LP
+To turn on an interface:
+.RS
+.nf
+.B ip link set up dev eth0
+.fi
+.RE
+.LP
+To add an IPv4 address to an interface:
+.RS
+.nf
+.B ip address add 141.85.37.42/24 dev eth0
+.fi
+.RE
+.LP
+To add a default route in the IPv4 routing table using a next hop IP address:
+.RS
+.nf
+.B ip route add  default via 141.85.37.1
+.fi
+.RE
+.LP
+Equivalent ways of listing address information for all the interfaces:
+.RS
+.nf
+.B ip addr show
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a s
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a
+.fi
+.RE
+.LP
+
 .SH HISTORY
 .B ip
 was written by Alexey N. Kuznetsov and added in Linux 2.2.
Signature · 1 line
1.7.4.1
#1 lore raw

man/man8/ip.8 can be

Quoted 9 lines · Alex Juncu
---
  man/man8/ip.8 |   43 +++++++++++++++++++++++++++++++++++++++++++
  1 files changed, 43 insertions(+), 0 deletions(-)
man/man8/ip.8 +0 -0
index a20eca7..99c8953 100644
@@ -2855,6 +2855,49 @@ can be

Although it's customary to put EXAMPLES near the bottom of the page, I suspect that the same users who are intimidated by the long usage description are unlikely ever to get this far. But I may be wrong; maybe people do specifically look for this section.

Alternately, it may be more helpful to reorder the SYNOPSIS to emphasise the most commonly used commands.

Ben.

Quoted 50 lines
man/man8/ip.8 +17 -0
  .SS ip xfrm monitor - state monitoring for xfrm objects
  The xfrm objects to monitor can be optionally specified.
 
+.SH EXAMPLES
+.LP
+To turn on an interface:
+.RS
+.nf
+.B ip link set up dev eth0
+.fi
+.RE
+.LP
+To add an IPv4 address to an interface:
+.RS
+.nf
+.B ip address add 141.85.37.42/24 dev eth0
+.fi
+.RE
+.LP
+To add a default route in the IPv4 routing table using a next hop IP 

address:
+.RS
+.nf
+.B ip route add default via 141.85.37.1
+.fi
+.RE
+.LP

man/man8/ip.8 +20 -0
+Equivalent ways of listing address information for all the interfaces:
+.RS
+.nf
+.B ip addr show
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a s
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a
+.fi
+.RE
+.LP
+
  .SH HISTORY
  .B ip
  was written by Alexey N. Kuznetsov and added in Linux 2.2.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#2 lore raw
In reply to Alex Juncu
Quoted 46 lines · On Thu, 24 Nov 2011 14:00:54 +0200 Alex Juncu <[email protected]> wrote:
---
  man/man8/ip.8 |   43 +++++++++++++++++++++++++++++++++++++++++++
  1 files changed, 43 insertions(+), 0 deletions(-)
man/man8/ip.8 +17 -0
index a20eca7..99c8953 100644
@@ -2855,6 +2855,49 @@ can be
  .SS ip xfrm monitor - state monitoring for xfrm objects
  The xfrm objects to monitor can be optionally specified.
 
+.SH EXAMPLES
+.LP
+To turn on an interface:
+.RS
+.nf
+.B ip link set up dev eth0
+.fi
+.RE
+.LP
+To add an IPv4 address to an interface:
+.RS
+.nf
+.B ip address add 141.85.37.42/24 dev eth0
+.fi
+.RE
+.LP
+To add a default route in the IPv4 routing table using a next hop IP 

address:
+.RS
+.nf
+.B ip route add default via 141.85.37.1
+.fi
+.RE
+.LP

man/man8/ip.8 +10 -0
+Equivalent ways of listing address information for all the interfaces:
+.RS
+.nf
+.B ip addr show
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a s

man/man8/ip.8 can be · line 2900

Quoted 10 lines
man/man8/ip.8 +10 -0
+.fi
+.RE
+.LP
+.RS
+.nf
+.B ip a
+.fi
+.RE
+.LP
+

Simple examples at bottom of page are good, but it is unnecessary to show how to abbreviate. That just confuses the newbie reading the examples.

Give one example of each of the basic normal tasks. See the git man pages for good examples.