why does tar archive directory differently based on command line?

Manish Jain bourne.identity at hotmail.com
Sun Feb 8 07:55:36 UTC 2015


Hi,

I am having problems trying to understand why does tar archive 
differently with the following 2 commands, presuming xyz is a 
sub-directory :

tar -c -f - ./xyz | gzip > xyz.tar.gz//xyz nested one level under . and ..
tar -c -f - xyz   | gzip > xyz.tar.gz//no . or ..

With the first invocation, I get a top-level nesting that just has . and ..
With the second, I get a top-level nesting that has xyz, which is much 
preferable

The first invocation leads to an absurdity that you have to cd into . 
(sounds recursively impossible) to actually get to xyz

Thanks for any help.

-- 
Regards,

Manish Jain
+91-98995-82709



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


More information about the freebsd-questions mailing list