Quantcast
Channel: Bart's Blog
Viewing all articles
Browse latest Browse all 20

improving find -exec efficiency

$
0
0

So today I learned about find -exec ... +

    $ mkdir 1 2 3 4
    $ for d in 1 2 3 4 ; do touch $d/{a,b} ; done
    $ find -type f -exec echo {} \;
    ./2/b
    ./2/a
    ./4/b
    ./4/a
    ./1/b
    ./1/a
    ./3/b
    ./3/a
    $ find -type f -exec echo {} +
    ./2/b ./2/a ./4/b ./4/a ./1/b ./1/a ./3/b ./3/a

... sweet!


Viewing all articles
Browse latest Browse all 20

Trending Articles