What is the syntax of grep command and what is its use?

Answers were Sorted based on User's Feedback



What is the syntax of grep command and what is its use?..

Answer / bharath

grep command is used to search a file for keywords.
grep 'keyword' file

Is This Answer Correct ?    9 Yes 0 No

What is the syntax of grep command and what is its use?..

Answer / amit

grep command is used to search the any word, any sentence
from given or input file.
syntex of grep command is
grep "word or sentence" filename

Is This Answer Correct ?    7 Yes 0 No

What is the syntax of grep command and what is its use?..

Answer / guest

grep " string" filename

Is This Answer Correct ?    3 Yes 1 No

What is the syntax of grep command and what is its use?..

Answer / ankita

grep is used to find the patterns inside files.

grep -options "pattern" file_name

grep -i "hello" test_file

this is search for "hello"(case doesn't matter as we have used -i) in test_file

Is This Answer Correct ?    0 Yes 0 No

What is the syntax of grep command and what is its use?..

Answer / shilpa

syntax= % grep pattern file-name-1 file-name-2
It is used to search files

Is This Answer Correct ?    0 Yes 1 No

What is the syntax of grep command and what is its use?..

Answer / bhaskar

syntax

grep "filename or string name"


It is used to find the values quickly

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Unix Commands Interview Questions

boot process?

2 Answers   Atos Origin, Wipro,


What does #!/ Bin sh do?

0 Answers  


Describe the zip/unzip command using gzip.

0 Answers  


Describe the usage and functionality of the command rm –r * in unix?

0 Answers  


How do you repeat a command in terminal?

0 Answers  






What do know about tee command and its usage?

0 Answers  


How do you list the files in an UNIX directory while also showing hidden files?

6 Answers  


What will the following command do?

0 Answers  


How do I use nslookup?

0 Answers  


if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command use in unix? plz send this question.

28 Answers   TCS,


How to use grep command to list find the records of a file containing 10 different strings?

0 Answers  


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

0 Answers  


Categories