I'm using this command to find specific files (2 files) which works as it should be on it's own;
find . -iname '*.txt' -o -iname '*.pdf'
and returns the correct files;
./.folder1/file1.txt
./.folder1/file1.pdf
./.folder2/file2.txt
./.folder2/file2.pdf
However, if I try to make these founded files into a tarball, it only includes the first -iname
part from the find command, like this;
find . -iname '*.txt' -o -iname '*.pdf' -print0 | xargs -0 tar -czvf files.tar.gz
so it doesn't include the *.pdf
s in this example and only includes *.txt
s in the tarball:
./.folder1/file1.txt
./.folder2/file2.txt
how can I fix this so it makes both *.txt
s and *.pdf
s into a tarball?