fgrep command in unix

the fgrep command is similar to grep, but with 3 main differences, you can use fgrep to search several targets at once, it does not allow you to use regular expressions to search for patterns, and is faster then grep.when you need to search a large files or several small files the differences in speed can be significant.

Searching for multiple targets:

the grep command prints all lines matching a particular pattern.

$fgrep “unix


>sqlserver” k2schools


100 ashu java k2schools

102 nalini SQLserver k2schools

105 ashok unix k2schools


by the way, you should notice here that when you give fgrep multiple search targets, each one must be on separate line. Note that you have to put the search string in quotation marks when it contains several targets.

Fgrep command doesnot accept regular expressions. The target must be text strings.

Related Posts

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools
%d bloggers like this: