I am looking for the best find. The reason is that the find user interface is not intuitive for me (in particular, the crop / print style) and it is difficult to wrap a function due to strict requirements for ordering arguments. locate / updatedb is not flexible enough to use instead. Would anyone like to share their example, find wrappers, or find alternatives (command line only)?
Here is an example of what I find unintuitive:
find dir_a dir_b \( -path dir_a/.git -o -path dir_b/out \) -prune -o \( -type f -o -type l \)
Setting directories before parameters is strange to me, and the trim syntax is easy to forget. (Some programs use the -exclude option instead.) I admit that this is a picky point.
Here is my best attempt to specify some default values without losing a lot of functionality:
f()
{
local a=()
while [[ -n "$1" ]] && ( [[ ! "${1:0:1}" =~ [-!(),] ]] || [[ "${1:0:2}" =~ -[HLPO] ]] )
do
a+=("$1")
shift
done
find -O3 "${a[@]}" -nowarn -regextype egrep "$@"
}
, / .
, GNU find, - , .
(2013-11-26):
- Itay ack . , , 95% .
- Ag, ack. .
(2014-11-23):
Ag. . , . , , , Find , .
(2017-08-04):
ripgrep Ag. , .gitignore, Ag, . Find.