Numbering each output line from a display command

You can use the | by-linenum option to prefix each display command output line with a number for easy identification.

Each line number is displayed as a 5-character string and might be followed by a colon (:) or hyphen (-). If you specify both | by-linenum and | begin regular-expression for a display command, a hyphen is displayed for all lines that do not match the regular expression.

To number each output line from a display command:

Task

Command

Number each output line from a display command.

display command | by-linenum

For example:

# Display system time information, numbering each output line.

<Sysname> display clock | by-linenum
    1:  06:14:21 UTC Sat 01/01/2011