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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it called grep?

740


What is rmdir command?

780


How do I search for a file in unix command?

730


What is .sh file?

828


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

793






Which command is used to kill the last background job?

996


Why is it called a shebang?

785


What command will change your prompt to myprompt?

899


What does touch command do in unix?

960


How do you repeat a command in terminal?

819


How can we use grep command in unix?

819


What is in grep command?

839


What do know about tee command and its usage?

838


What are the unix commands?

742


What is awk command used for?

778