![]() Here, 7 is the line number on which the pattern we've searched for ( text) was found.įor more information and advanced usage, see the grep man page. home/logix/Documents/test/folder/file2.txt:7:text Grep -Rni -exclude-dir= 'text' ~/DocumentsĮxample output: /home/logix/Documents/test/folder/file1.js:7:text In that case, the command you'd need to use would be (this is a single command): Also, you want to show the line numbers ( -n), search recursively and also follow all symbolic links ( -R). Let's say you want to find all files containing the case-insensitive ( -i) text in the ~/Documents folder and its subfolders except for the Private and Personal subfolders ( -exclude-dir), and only search in the files that have the. Let's take a look at an example which combines these command line flags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |