Find and grep command

When do we use "find" and "grep" command? Explain with an example.

  
Showing Answers 1 - 6 of 6 Answers

akilah

  • Jun 7th, 2015
 

grep command is basically use to search a string in a file. with grep command can search a string in a particular line, in entire file, to get unmatched lines etc.
eg: to search a word unix in file.txt
command is : grep "unix" file.txt
FIND: find command is use to search for a file in directory or system.
syntax: find search_path -name filename
eg: to search in current directory or any sub directoy
1. find . -name file.txt
2. to search in entire system
find / -name file.txt

  Was this answer useful?  Yes

arpita maniyar

  • Jul 18th, 2015
 

Grep command is used for search a string to particular file

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions