Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with tar files

Status
Not open for further replies.

yekaterina

Programmer
Jun 3, 2003
2
US
Hi,

Is there any way to add a file to *.tar.gz file without open it?

Thank you.
 
Check the help or man pages for your version. Some (SCO) don't allow this. GNU tar does allow this - but only on uncompressed archives. This means you need to gunzip the tar file first, then append to it, then gzip it again.

tar --help

and then look at the -r (--append) and -u (--update) options.

Your command might look like this:

tar -rvf oldfile.tar ./file.to.add
 
Hemo is correct. You will have to gunzip the compressed file first. The man pages state that you can us the -r option but the file must be of the same Block Size.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top