Sponsored Content
Special Forums UNIX Desktop Questions & Answers Difference grep, egrep and fgrep Post 302125624 by ravind27 on Friday 6th of July 2007 04:43:06 AM
Old 07-06-2007
Difference grep, egrep and fgrep

Hi All,

Can anyone please explain me the difference between grep, egrep and fgrep with examples.

I am new to unix environment.. Your help is highly appreciated.

Regards,
ravi
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I need help with fgrep or grep

How can I do an and condition with fgrep. I want to do: ps -ef | fgrep -f searchvalues > tempmail.file mailx -s "Email Subject" email@domain.com < tempmail.file The search values file contains: opt/bea.*java.*80 mysqld What I want is to find things that contain: mysqld OR... (7 Replies)
Discussion started by: jimmy
7 Replies

2. UNIX for Dummies Questions & Answers

grep/awk/egrep?

Hi, The input file "notifications" contains the following string. FRTP has 149 missing batches I want to search for : FRTP has missing batches As the number 149 is not important and will change. The commands I have tried. grep "FRTP has.*missing batches" notifications.txt... (3 Replies)
Discussion started by: whugo
3 Replies

3. UNIX for Dummies Questions & Answers

Difference between grep, egrep & grep -i

Hi All, Please i need to know the difference between grep, egrep & grep -i when used to serach through a file. My platform is SunOS 5.9 & i'm using the korn shell. Regards, - divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies

4. Shell Programming and Scripting

Fgrep or grep or awk help - scanning for delimiters.

Hi, I'm struggling a little here, so I figured it's time to ask for help. I have a file with a list of several hundred IDs (the hit file- "hitfile.txt"), which is newline delimited, and a much bigger (~500Mb) text file, "FASTA.txt" with several thousand entries, delimited by ">". It's the... (8 Replies)
Discussion started by: Tbox
8 Replies

5. Shell Programming and Scripting

grep/fgrep/egrep for a very large matrix

All, I have a problem with grep/fgrep/egrep. Basically I am building a 200 times 200 correlation matrix. The entries of this matrix need to be retrieved from another very large matrix (~100G). I tried to use the grep/fgrep/egrep to locate each entry and put them into one file. It looks very... (1 Reply)
Discussion started by: realwindfly
1 Replies

6. Shell Programming and Scripting

Using grep or egrep

So a few months ago, I decided to move away from using grep and decided to use egrep in this code that i'm writing. i figured egrep is more robust than grep. well, it appears it isn't. when i used egrep to search the log file for a script that looked like the following, egrep couldn't find... (3 Replies)
Discussion started by: SkySmart
3 Replies

7. Homework & Coursework Questions

grep and egrep

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have a text file. 1) How do I search for x and y? 'Find all lines that contain David and Emily' 2) How do I... (1 Reply)
Discussion started by: ninjagod123
1 Replies

8. Shell Programming and Scripting

grep/egrep fails with $ anchor?

The $ seems to fail for me. I'm using GNU grep 2.5.4 (that is, nothing out of the ordinary, just what came with my distro) but I can't get the final anchor $ to work for me. (^ works as usual.) Behavior without anchor: $ /bin/grep -E 'tium' file tritium tertium quid Expected behavior: $... (2 Replies)
Discussion started by: CRGreathouse
2 Replies

9. Shell Programming and Scripting

Fgrep/grep -f and literal strings

I have a file like this: cat file name = server jobname = 1010 snapshot_name = funky_Win2k12_20140213210409 I'm trying to use grep to isolate that first line (name = server), but grep -f "name = " file as well as fgrep "name = " file returns all 3 lines. How do I return... (1 Reply)
Discussion started by: ampsys
1 Replies

10. UNIX for Advanced & Expert Users

Need to use fgrep and egrep in a single command

I have a source file which is something like : C/*M/ / ***HMACCT ** MONTH FOR CURRENT MINUS 14 CAL DAY C/*D/ / ***HMACCT ** DAY FOR CURRENT MINUS 14 CAL DAY C/*X/ / ***HMACCT ** CENTURY FOR CURRENT MINUS 14 CAL DAY C/*Y/ / ***HMACCT **... (5 Replies)
Discussion started by: gotamp
5 Replies
GZGREP(1)						      General Commands Manual							 GZGREP(1)

NAME
gzgrep, gzegrep, gzfgrep - search possibly compressed files for a regular expression SYNOPSIS
gzgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
gzgrep is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci- fied, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If gzgrep is invoked as gzegrep or gzfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, gzgrep uses it as the grep program to be invoked. For example: for sh: GREP=fgrep gzgrep string files for csh: (setenv GREP fgrep; gzgrep string files) AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), egrep(1), fgrep(1), gzdiff(1), gzmore(1), gznew(1), gzforce(1), gzip(1), gzexe(1) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgzip | +--------------------+-----------------+ |Interface Stability | External | +--------------------+-----------------+ NOTES
Source for gzip is available in the SUNWgzipS package. GZGREP(1)
All times are GMT -4. The time now is 12:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy