4 ms·
> macOS tar had the same results when using the appropriate sorting flag They had to install and use GNU tar to gain the `--sort` option. macOS (BSD) tar doesn
by js2 6y ago
> macOS tar had the same results when using the appropriate sorting flag
They had to install and use GNU tar to gain the `--sort` option. macOS (BSD) tar doesn't have it. (You could emulate the behavior by using `find` and passing the member names in on the command-line.)
- mjevans 6y agoAs mentioned near the end of your comment: typically a workaround (possibly with temporary files instead) E.G. find /path | sort | bsdtar -c -f OUTPUT -n --files-from /dev/stdin ...Args I prefer the second version which terminates paths with the NULL character. Both include -n to not-recurse. find /path -s -print0 | bsdtar -c -f OUTPUT --null -n --files-from /dev/stdin ...Args From the BSD manpage: -s Cause find to traverse the file hierarchies in lexicographical order, i.e., alphabetical order within each directory. Note: `find -s' and `find | sort' may give different results.