Quote:
Originally Posted by
Raj999
Hi Cragun
I have used the tar -u but it is adding the file if u specify to the tar file.
It is not updating the whole list of files in the tar.
With both tar -u and -r, I have to specify the file name that needs to be changed. But i want the whole list of files in the .tar to be updated.
Thanks
Rajnish
OK. Now I get it. You want
tar to read your mind and magically devine what files in your archive you want to update.
Sorry, but
tar doesn't work that way. The way it works is you tell
tar:
- what archive you want to create and the list of files to put into that archive(tar c),
- what archive to which you want to add new or replacement files and the list of files to add to the end of that archive (tar r), or
- what archive you want to update and the list of files to be added to or replaced in that archive (tar u).
It sounds like you just want to use
tar c to recreate your archive from your original list of files. So, just use the command that created your archive in the first place to recreate your archive after you have updated the files you want in your updated archive.
You could also consider using
tar t to get a list of files in an archive and use
cpio or
pax or
tar c to update that list of files into another archive.