![]() $ cat sample.txt This is the sample file. As you can see, the only matches for the string “this” are the capitalized string “This”. I limit the search to only text files in the current directory *.txt and the -i option makes the search case-insensitive. One of the most basic ways to use grep is shown below, looking for the lines of a file that match a pattern. Grep can check the file that you specify or can search an entire tree of your filesystem recursively looking for matching files. You can use grep to see if a file contains a word or use one of many forms of regular expression to search for a pattern instead. The grep command is a very powerful way to find documents on your computer. Learn the basics of grep with this tutorial from our archives.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |