*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> fgrep (1)              


FGREP(1)							      FGREP(1)

NAME    [Toc]    [Back]

     fgrep - search a file for a character string

SYNOPSIS    [Toc]    [Back]

     fgrep [options] string [file ...]

DESCRIPTION    [Toc]    [Back]

     fgrep (fast grep) searches	files for a character string and prints	all
     lines that	contain	that string.  fgrep is different from grep(1) and
     egrep(1) because it searches for a	string,	instead	of searching for a
     pattern that matches an expression.  It uses a fast and compact

     The characters $, *, [, ^,	|, (, ), and \ are interpreted literally by
     fgrep, that is, fgrep does	not recognize full regular expressions as does
     egrep.  Since these characters have special meaning to the	shell, it is
     safest to enclose the entire string in single quotes '...'.

     If	no files are specified,	fgrep assumes standard input.  Normally, each
     line found	is copied to the standard output.  The file name is printed
     before each line found if there is	more than one input file.

     Command line options are:

     -b	   Precede each	line by	the block number on which it was found.	 This
	   can be useful in locating block numbers by context (blocks are 512
	   bytes long and number from 0).
     -c	   Print only a	count of the lines that	contain	the pattern.
     -i	   Ignore upper/lower case distinction during comparisons.
     -l	   Print the names of files with matching lines	once, separated	by
	   new-lines.  Does not	repeat the names of files when the pattern is
	   found more than once.
     -n	   Precede each	line by	its line number	in the file (first line	is 1).
     -s	   Silent mode.	 No pattern matches or error messages are printed.
	   This	option allows command expressions to check fgrep's exit	status
	   without having to deal with output.
     -v	   Print all lines except those	that contain the pattern.
     -x	   Print only lines matched entirely.
     -e	special_string
	   Search for a	special	string (string begins with a -).
     -f	file
	   Take	the list of strings from file.

SEE ALSO    [Toc]    [Back]

     ed(1), egrep(1), grep(1), sed(1), sh(1).

DIAGNOSTICS    [Toc]    [Back]

     Exit status is 0 if any matches are found,	1 if none, 2 for syntax	errors
     or	inaccessible files (even if matches were found).

									Page 1

FGREP(1)							      FGREP(1)

BUGS    [Toc]    [Back]

     Ideally there should be only one grep command, but	there is not a single
     algorithm that spans a wide enough	range of space-time tradeoffs.	Lines
     are limited to BUFSIZ characters; longer lines are	truncated.  BUFSIZ is
     defined in	/usr/include/stdio.h.

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
strchr Tru64 Search for character in string
rindex Tru64 Search for character in string
index Tru64 Search for character in string
strrchr Tru64 Search for character in string
wcschr Linux search a wide character in a wide-character string
wcsrchr Linux search a wide character in a wide-character string
wcscspn Linux search a wide-character string for any of a set of wide characters
wcspbrk Linux search a wide-character string for any of a set of wide characters
wcsrtombs NetBSD converts a wide character string to a multibyte character string (restartable)
mbsrtowcs NetBSD converts a multibyte character string to a wide character string (restartable)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service