C i s c o C o n f i d e n t i a l - B e t a R e v i e w R 3 . 7. 1
Utility Commands on Cisco IOS XR Software
utility fgrep
SMR-751
Cisco ASR 14000 Series Router System Management Command Reference
OL-17231-01
utility fgrep
To search a file for a fixed character string, use the
utility fgrep
command in EXEC mode or
administration EXEC mode.
utility fgrep
{
exp
expression
|
script
expression-file
} [
WORD
|
count
|
noprefix
|
nocase
|
matchfile
|
linenum
|
matchline
|
reverse
] [
file
search-file
] [
usage
]
Syntax Description
Defaults
The keyboard input (standard input) is used if no files are specified.
If more than one input file is specified, then the filename is displayed before each line.
Command Modes
EXEC
Administration EXEC
exp
expression
(
-e
) A regular expression, whose type is determined by the -e and -f options.
This form is used when only one expression is specified on the command
line. Any names specified after this option are treated as input files.
script
expression-file
(
-f
) A file containing a set of regular expressions, each separated by a new
line. The type of the expressions is determined by the -e and -f options. This
form is used when more than one expression is specified. You can specify
more than one -f option.
The
expression-file
syntax is:
device
:
[
/
directory-path
]
/
filename
Include the alias for the
device
argument, followed by a colon, and,
optionally, the name of a directory. Use the online help system to display the
available storage devices and network protocols.
file
search-file
The file used for the search. Replace the
search-file
argument with the device
and directory path of the file. The
search-file
syntax is:
device
:
[
/
directory-path
]
/
filename
count
(Optional) (
-c
) Displays a count of selected lines.
noprefix
(Optional) (
-h
) Displays results without a filename prefix attached to the
matched lines. This option applies only when more than one file is searched.
nocase
(Optional) (
-i
) Ignores uppercase and lowercase distinctions during
comparisons.
matchfile
(Optional) (
-l
) (“el”) Displays only the names of files containing the selected
lines.
linenum
(Optional) (
-n
) Before each output line, displays the line's line number.
matchline
(Optional) (
-x
) Includes only input lines selected against an entire fixed
string or regular expression.
reverse
(Optional) (
-v
) Selects only those lines that don't match the specified
patterns.
usage
(Optional) Displays the UNIX options supported by this command.
WORD
(Optional) UNIX command-line option string. The maximum number of
characters is 20.