Best GNU Replacement

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()
{
  # The trouble is that -regextype must appear after path but before expression.
  # HACK: "-D debugopts" unsupported and -[HLPO] options assumed to before dirs.
  local a=()
  while [[ -n "$1" ]] && ( [[ ! "${1:0:1}" =~ [-!(),] ]] || [[ "${1:0:2}" =~ -[HLPO] ]] )
  do
    a+=("$1")

    # Eliminate arg from @.
    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.

+3
1

Ack, find, grep, .

+2
source

All Articles