Venu
Venu

Reputation: 363

how to create tar file so that files at placed at root folder of tar.gz file

I need to create targ.gz file and contents of file should be at root folder

say. I want angle and Simple files at root of tarfile shown at bottom. Any suggestions. I tried as below but extra folder is created at root

tar -zcvf tarfile.tar.gz -C /example/tarFile .
./
./angle.txt
./Simple.jar

tar -zcvf tarfile.tar.gz -C /example/tarFile .
./angle.txt
./Simple.jar

Upvotes: 0

Views: 1917

Answers (1)

Manish
Manish

Reputation: 667

Please try this

tar -czvf tarfile.tar.gz /example/tarFile

after creating tar file use cp or mv command to move anywhere you want.

Upvotes: 1

Related Questions