For file-count-based progress, you need a find that supports -print0; this includes GNU find (most
Linuxes have this) and the find command found natively on at least two of the BSD's.
For file-size-based progress, you have two options:
- Use a "find" command that supports -printf; this includes GNU find but not FreeBSD's find. Use
such a find command with the full-prestat progress mode.
- Use a "find" command that supports -print0, in the full-poststat progress mode. This is a little
slower than full-prestat, but should be OK in most situations.
Faking find -print0:
- You can kind of fake having -print0 with "find / -xdev -print | tr '\012' '\0'".
- Of course, this is going to make a mess of files that have newlines in their filenames - which should be rare, but isn't
impossible.
- This should be necessary on very few systems; almost all find's have a -print0 now. Some find's do not have a -printf though.
Generally speaking, file-size-based progress is more accurate than file-count-based progress.
See Example use for examples of the above.