linux - Create tar.gz archive and add all files and folders without parent folder -
for example have folder "admin" contains folder "1" , 2 php files "index.php" , "page.php". try use tar -zcvf admin.tar.gz admin
, got admin.tar.gz archive. if open archive, can see archive contains "admin" folder , inside directory folder "1" , 2 php files.
i want create tar.gz archive files , folders, without parent folder. create archive , contains folder "1" , 2 php files. how can it?
you can use -c
option:
tar -c admin -zcvf admin.tar.gz .
see man tar
-c, --directory=dir change dir before performing operations. option order-sensitive, i.e. affects options follow.
Comments
Post a Comment