-
Notifications
You must be signed in to change notification settings - Fork 1
Usage
-
Here are two cases where ifind help me a lot:
-
At work, when I run into a big project, created and mantained by someone else, to find imports and variables, ifind provides me a simple list of files where the import/variable is present, with a more readable output compared to the grep -Fr one.
-
At work, on servers that host a lot of sites, if I have to find a path to some file/service, related to some customer, without knowing its location, using ifind with the name of the customer/service will return by default a simple output with the path to files that match, but without the content of the matching lines and so no filepath will be repeated in the output.
-
-
Basic usage is:
- ifind <dir> <search>
-
Where dir is a directory and search, by default, is a string. The tool will scan the directory recursively.
-
To ignore case use the -i/--case-insensitive option.
- ifind -i <dir> <search>
-
You can user regex as search using the -r/--regex option.
- ifind -r <dir> <search> # search is a regex pattern
-
If you need to know, for all files, the number of matching lines use -n/--lnumber:
- ifind -n <dir> <search>
-
Lastly you can get a full output (file : line-number : line) similar to grep -Fr one with -l/--print-lines option:
- ifind -l <dir> <search>