![]() Now you can search all of them together with grep using the “-R” command. To make things easy for you, you create a new folder containing symbolic links to all the various log files that are of interest to you. After all, many packages have their own locations for log files. Let’s say for example, that you have a bunch of log files scattered all around the system. However, we can also use it to search an entire directory of files at the same time. We normally think of grep searching either a file or a specific output from another command. Searching an Entire Directory for a Match and Showing the File Name If you want to remove the “words” requirement and instead just want a straight up string match, then you can drop the “w” parameter. We can match as many words as we need to that way. So the above command becomes: egrep -w 'sparrow|dogs' animal-count To make it even easier, we can just replace “grep -E” with “egrep”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |