Hacker News new | past | comments | ask | show | jobs | submit login

> 6. List contents of tar.gz and extract only one file

> tar -ztvf file.tgz

> tar -zxvf file.tgz filename

Tar no longer requires the modifier for the compression when extracting an archive. So no matter if it's a .tar.gz, .tar.Z, .tar.bz2, etc you can just use "tar xvf"




And the same for compression..

    tar caf foo.tar.xz foo/
The extension of the file after the `f` switch tells tar what compression to use.

c - compress

a - auto


by tar you mean gnu tar




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: