When adding an updated version of a file to a tar file using '-u', and looking at the tar file with '-t', I notice that a newer version gets added to the end (the tar file also increases in size); both showing with the same name, and no other info. This process can be repeated. After un-taring it with '-x', the correct, newest version is produced (I assume tar actually un-tars all, but newer versions keep over-writing older ones). 

As the older versions are apparently kept, is it possible to

(1) get more info (e.g., date created or archived) on the versions kept when using '-t', 

(2) selectively delete certain older versions (--delete removes all), and

(3) un-tar a specific older version as opposed to using '-x' only which gives the newest (for which one would need to first understand (1), obviously)? 

I am working under Ubuntu 12.04, in case this depends on distro/version.


1 Answer 1


Yes that's all possible.

1) Use the -v switch, and it will list the file information.

tar tvf mytar afile

2) Use the --occurrence=n option.

tar f mytar --occurrence=2 --delete afile

3) Use the --occurrence=n option.

tar xf mytar --occurrence=1 afile

See the tar documentation: http://www.gnu.org/software/tar/manual/tar.html


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .