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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -