![]() If you want to study the grep command in depth, have a look at the man pages. We can achieve that using the command below: grep -L "fruit" * Let's say we want to list files that do not contain the word "fruit". More-fruits.txt fruits.txt and more-fruits.txt contain the string fruit Note that the * searches for all the files in the folder. We can do that like this: grep -l "fruit" * Next, we want to see files that contain the pattern "fruit". Contents of more-fruits.txt cat vegetables.txt ![]() Contents of fruits.txt cat more-fruits.txt ![]() The files have the following content: cat fruits.txt rw-r-r- 1 zaira zaira 194 Jan 16 20:33 more-fruits.txt rw-r-r- 1 zaira zaira 47 Jan 16 20:31 vegetables.txt rw-r-r- 1 zaira zaira 327 Jan 16 19:25 fruits.txt Let's say we have the following files in our folder: ls -lrt
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |