I want to create tar file of a folder but this folder contains some tar.gz files like abc.tar.gz, pqr.tar.gz which i don't want to include so how to exclude this files while making the tar
What about something like:
find ./ -name '*.tar.gz' > /tmp/excludefiles tar -czvf newarchive.tar.gz -X /tmp/excludefiles foldertotar/
I haven't test it. It's only idea how to solve it.
It's even simpler:
tar -czvf newarchivename.tar.gz --exclude '*.tar.gz' foldertobetarred/
This solution is tested and works.