3 ms·
Using \+ instead of \; will do the same (fork less). du -a will need to do a stat to get the file size, which is comparatively expensive; I don't think find wi
by arp242 3y ago
Using \+ instead of \; will do the same (fork less).
du -a will need to do a stat to get the file size, which is comparatively expensive; I don't think find will (not sure)?
- jlokier 3y agoYou're right, find won't call stat() unless it needs to. It doesn't need to for recursing through the directory tree because readdir() returns dirent.d_type these days to determine if a name is a directory. Yes, those stat() calls can be very slow in aggregate on a large tree, especially from HDD (due to seeking) or network filesystem, if the stat information isn't already in cache.
- geosh 3y agoOh, I forgot about \+. I still pipe to xargs every single time.