I am wondering whether I can incrementally delete the contents of an archive (at a minimum .tar
, though ideally also .tar.xz
or similar) as I am extracting them all. The ultimate goal is to remove the necessity to have twice the space required for the files available while downloading and extracting.
I have looked around a bit, and it seems tar has a --remove-files
option, which is compatible with archiving, but this only seems to work when creating an archive. The --delete
option seems to work when extracting as well, but it only seems to work with .tar
. Would it in this case be possible to replace the .tar.xz
with an unarchived .tar
in-place and then proceed to obtain the list of contents somehow and iteratively extract them with --delete
? Or is there a better way of doing this?