Home > Mobile >  parallel version of find command on Linux
parallel version of find command on Linux

Time:09-27

On zsh shell, I put into my ~/.zshrc the following function :

ff () {
    parallel -j8 find {} -type f ::: $1/* | grep -i $2
}

The goal is to do a "parellel" version of classical find function.

But unfortunately, it doesn't seem to work : for example, in a directory containing R scripts, I am doing :

ff . '*.R'

But this command doesn't return anything. I would be grateful if someone can see what's wrong with my function ff.

CodePudding user response:

By default grep uses basic regular expressions, so calling the function with another asterisk should work

ff . '**.R'

to ignore files like foo.r.bar

ff . '**.R$'
  • Related