GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
FGREP(1) User Commands FGREP(1)

fgrep - search a file for a character string

/usr/local/heirloom/usr/5bin/fgrep [-e string_list ...] [-f string_file] [-bchilnrRvxz] [string_list] [file ...]

/usr/local/heirloom/usr/5bin/posix/fgrep -e string_list ... [-f string_file] [-c|-l] [-bhinrRvxz] [file ...]

/usr/local/heirloom/usr/5bin/posix/fgrep -f string_file [-e string_list ...] [-c|-l] [-bhinrRvxz] [file ...]

/usr/local/heirloom/usr/5bin/posix/fgrep [-c|-l] [-bhinrRvxz] string_list [file ...]

The fgrep command searches the lines of the specified files (or of standard input) for occurrences of any of the newline separated strings in string_list. The default behavior is to print each matching line to standard output.

Both /usr/local/heirloom/usr/5bin/fgrep and /usr/local/heirloom/usr/5bin/posix/fgrep accept the following options:

-b
Each line is preceded by the block number on which it was found. This is sometimes useful in locating disk block numbers by context. Block numbers start with 0.
-c
Only a count of matching lines is printed.
-e string_list
Specifies one or more strings, separated by newline characters. A line is selected if one or more of the specified strings are found.
-f string_file
One or more strings, separated by newline characters, are read from string_file. If multiple -e or -f options are supplied to /usr/local/heirloom/usr/5bin/posix/fgrep, all of the pattern lists will be evaluated.
-h
Normally, the name of each input file is printed before a match if there is more that one input file. When this option is present, no file names are printed.
-i
Upper- and lowercase differences are ignored when searching matches.
-l
The names of files with matching lines are listed (once) separated by newlines.
-n
Each line is preceded by its line number in the file. Line numbers start with 1.
-v
All lines but those matching are printed.
-x
(Exact) only lines matched in their entirety are printed.

The following options are supported as extensions:

-r
With this option given, fgrep does not directly search in each given file that is a directory, but descends it recursively and scans each regular file found below it. Device files are ignored. Symbolic links are followed.
-R
Operates recursively as with the -r option, but does not follow symbolic links that point to directories unless if they are explicitly specified as arguments.
-z
If an input file is found to be compressed with compress(1), gzip(1), or bzip2(1), the appropriate compression program is started, and fgrep searches for the pattern in its output.

/usr/local/heirloom/usr/5bin/s42/fgrep and /usr/local/heirloom/usr/5bin/posix2001/fgrep are identical to /usr/local/heirloom/usr/5bin/posix/fgrep.

LANG, LC_ALL
See locale(7).
LC_CTYPE
Determines the mapping of bytes to characters and the case mapping for the -i option.

ed(1), egrep(1), grep(1), sed(1), locale(7)

Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors or inaccessible files.
1/24/05 Heirloom Toolchest

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.