If you have too many files to add to a tarball, you can run into the shell's command limitation. If you use xargs + tar cf, you'll not get all of your files added to the tarball. Use tar'srf
command to append to an archive rather than creating one:% find . -name "*.yuck" -print0 | xargs -0 tar rvf oop.tar-print0
(zero) tells find to output the filenames with trailing NUL characters (rather than newlines), and-0
tells xargs to use a NUL as its input separator, rather than newlines/spaces. The upshot is that you can handle filenames with spaces in them.Thanks to Ben Cox for the -print0 / -0 suggestion.