how to use grep command to list find the records of a file
containg 10 different strings

Answers were Sorted based on User's Feedback



how to use grep command to list find the records of a file containg 10 different strings..

Answer / raghu

egrep "word1|word2" filename

Is This Answer Correct ?    27 Yes 2 No

how to use grep command to list find the records of a file containg 10 different strings..

Answer / siva

try this command

egrep "string1|string2|string3" <filename.extn>

Is This Answer Correct ?    12 Yes 2 No

how to use grep command to list find the records of a file containg 10 different strings..

Answer / raja

egrep "string1|string2" *.*

Is This Answer Correct ?    0 Yes 1 No

how to use grep command to list find the records of a file containg 10 different strings..

Answer / supriya

grep 'word1|word2' <filename>

Is This Answer Correct ?    1 Yes 5 No

how to use grep command to list find the records of a file containg 10 different strings..

Answer / umakanta

grep -w 'word1|word2' filename

Is This Answer Correct ?    8 Yes 14 No

Post New Answer

More Unix General Interview Questions

Name two paging states for a page in memory?

0 Answers  


How to find out what processes are running in the background in unix?

0 Answers  


Is it possible to count number char, line in a file; if so, How?

0 Answers  


What are internal and external commands in unix?

0 Answers  


Interviewer: Lets say there is a partition of 100GB. When i tried to create a file using touch command, under any directory, it was unable to create the file- '100% full disk space'. I calculated the size of each and every directory on that partition mannually by adding each file size & in came out to be total size 50GB. Then where is the remaining 50GB ? why it is showing disk space 100% full in 'df -h' command?

2 Answers   Infosys,






Why was unix created?

0 Answers  


Explain about the directory representation in UNIX?

0 Answers  


"ls" command is showing all the subdirectoary and files which are present in the current directoary, i want to cut only directoary name. How to cut only name ?

2 Answers   Cap Gemini,


What does pipe do in unix?

0 Answers  


Describe the term inode?

0 Answers  


What is grep family in unix?

0 Answers  


What are conditions on which deadlock can occur while swapping the processes?

0 Answers  


Categories