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

What is difference between grep and find command in unix?

0 Answers  


what is the difference between Touch & cat command

21 Answers   QA,


What is command statement?

0 Answers  


What will the following command do?

0 Answers  


What UNIX command will control the default file permissions when files are created?

4 Answers  


Why is awk called awk?

0 Answers  


Which RAID Levels supported by LVM?

5 Answers  


How can i know my Filesystem and its current usage in my prod UNIX system?

4 Answers   HCL, IBM,


what is the use of "grep" command?

6 Answers   HCL,


Are you in or at the office?

0 Answers  


How do I search for text in vi?

0 Answers  


How do you find path of a directory? Give its syntax.

7 Answers  


Categories