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

How to display no of records in oracle using unix command?

591


What is the first character of the output in ls l command?

637


What does the command ' $who | sort –logfile > newfile' do?

774


How do I search a whole word in vim?

697


Which unix command lists files/folders in alphabetical order?

622






Which command is used to copy files?

562


What is command substitution?

627


What is the search command in unix?

609


What is the command to view process running?

578


How do you grep recursively?

562


What does find command return in unix?

598


Who invented grep?

657


What does the md command do?

578


What is the comma to show the space allocation of files?

562


How do I open a port?

596