I want to compress the contents of:
/ebs1/xxx/aaa/bbb/
So, all the files and folders inside "bbb" I want to be compressed to a file named "xxx.tar.gz" I am using:
tar -zcvf "xxx.tar.gz" "/ebs1/xxx/aaa/bbb/"
It's ok. But when I open the file "xxx.tar.gz" the tree directories start at
/ebs1 -> /xxx -> /aaa -> /bbb ->
and after this I can see the content.
Is it possible to tell tar not to include the parent directories in the compressed files, so when I extract it I dont need to open all directories to get to my content?
Try this:
tar -czvf xxx.tar.gz -C /ebs1/xxx/aaa/bbb .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With