Re: why does tar archive directory differently based on command line?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 02/08/2015 12:53 AM, Manish Jain wrote:

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.


So, what do you see to be the huge difference:

$ tar cf - ./xyz  | gzip > xyz1.tar.gz
$ tar cf - xyz    | gzip > xyz2.tar.gz

$ tar ztvf xyz1.tar.gz
drwxr-xr-x jd/jd             0 2015-02-08 11:12 ./xyz/
-rw-r--r-- jd/jd            18 2015-02-08 11:13 ./xyz/c
-rw-r--r-- jd/jd            18 2015-02-08 11:13 ./xyz/b
-rw-r--r-- jd/jd            18 2015-02-08 11:12 ./xyz/a

$ tar ztvf xyz2.tar.gz
drwxr-xr-x jd/jd             0 2015-02-08 11:12 xyz/
-rw-r--r-- jd/jd            18 2015-02-08 11:13 xyz/c
-rw-r--r-- jd/jd            18 2015-02-08 11:13 xyz/b
-rw-r--r-- jd/jd            18 2015-02-08 11:12 xyz/a



--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux