Grep & Find
The main difference between the two is that grep is used to search for a particular string in a file
whereas
find is used to locate files in a directory,
also you might want to check out the two commands by typing 'man find' and 'man grep'.
Grep command:-> is used for finding any string in the file.
Ex-> 1. grep <String> <filename>
2.grep 'abc xyz' jump.txt
The Above noticable point that it display the whole line,in which line abc xyz string is found.
Find command :-> used to find the file or directory in given path,
Ex-> 1. find <filename>
2. find jump*
display all file name starting with jump,
3. find jump*game.txt
The above noticable point that it display all file in current directory starting with jump and ending with game.
No comments:
Post a Comment