![]() Let us find text called “redeem reward” in files under Linux: In this example, search for a string called ‘redeem reward’ in all text (*.txt) files located in /home/tom/ directory, use: How to search and find all files for a given text string Let us see some common example on how to use grep to search for strings in files. Grep -r -H " text string to search" directory-pathĮgrep -R " word-1|word-2" /path/to/directoryĮgrep -w -R " word-1|word-2" directory-path Grep -r " text string to search" /directory-path Grep " text string to search" directory-path ![]() The Linux syntax to find string in files is as follows: ![]() Grep command syntax for finding a file containing a particular text string
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |