3 ms·
Ok just tried it and it's not great for all occasions. Ex. i have a dir with 2 million files with an avg size of about 3 kilobytes. ls -f /data/ | wc -l
by lqdc13 11y ago
Ok just tried it and it's not great for all occasions.
Ex. i have a dir with 2 million files with an avg size of about 3 kilobytes.
ls -f /data/ | wc -l
2183060
So I try to find a pattern:
time find "/data/" -name "*txt" -type f -print0 | LC_ALL=C xargs -0 -P 6 -n 40 fgrep -iq "let the right one in"
real 0m3.755s
user 0m3.085s
sys 0m17.764s
Then try sift with same command:
time find "/data/" -name "*txt" -type f -print0 | LC_ALL=C xargs -0 -P 6 -n 40 sift -iq "let the right one in
real 0m35.956s
user 0m55.170s
sys 3m32.120s
Or try sift by itself:
time sift -rq --files="*txt" "let the right one in" /data/
And it is:
real 0m9.298s
user 0m29.620s
sys 0m12.371s
Sticking with grep for now.