I have following in a directory:
dir1
dir2
file1
file2
I want to tar up everything except dir1
When I do:
find . -path '*dir1*' -prune -o -print
I don't see dir1 in the output ( as expected)
But when I do:
find . -path '*dir1*' -prune -o -exec tar -czvf documents.tgz '{}' \+
I see that dir1 also gets tarred up in documents.tgz. Why ?
*
instead of.
to exclude the current working directory.