Then combine find and the non-recursive use of grep, as a portable solution : find /dir \( -name node_modules -prune \) -o -name "*.sh" -exec grep -color -Hn "your text to find" debugger. To list the supported filetypes, use rg -type-list. null-data ensures that we retain our NUL bytes. rg '.\.h' -null-data only matches lines from the file list that end with. rules and automatically skip hidden files/directories and binary files. ripgrep: print only filenames matching pattern. Breaking it down: rg -files -0 prints all of the files it would search, on stdout, delimited by NUL. ripgrep recursively searches directories for a regex pattern while. For example, to exclude dir1 and dir2, use the following command: rg pattern -g 'dir1/' -g 'dir2/' Changelog References Ripgrep user’s guide. (These heuristics can of course be disabled. To exclude directories, we also use the -g option. ![]() You might say, 'well I can do that with grep -excludetarget,' and while that's true, the benefit of ripgrep is that it does it for you automatically for any repo of code. GitHub - BurntSushi/ripgrep: ripgrep recursively searches directories for a regex pattern while respecting your gitignore BurntSushi / ripgrep Public Notifications Fork 1.7k Star 38. to make sure of Projectiles commands projectile-ag and projectile-ripgrep. Use find, for excluding directories foo and bar : find /dir \( -name foo -prune \) -o \( -name bar -prune \) -o -name "*.sh" -print gitignore file, so ripgrep will see that and ignore it automatically for you. If you have a projects directory, you can tell Projectile about all of the. ![]() ![]() The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |