samedi 29 novembre 2014

'Tar' the result of a 'find', preserving the directory structure


I want to tar all the *.txt file, that I get from the result of a find , that exist into a directory having a tree like this:



  • Directory_name



    • dir1







      • file1.pdf









      • file1.txt







    • dir2







      • file2.pdf









      • file2.txt







    • dir3







      • file3.pdf









      • file3.txt






(used name are just as example)


But I want to preserve the directory structure.


What is the command the could give me a tar.gz file with this content?



  • dir1



    • file1.txt



  • dir2



    • file2.txt



  • dir3



    • file3.txt





Aucun commentaire:

Enregistrer un commentaire