I am aware of that I can extract single/multiple files from a tar archive, but is there a command that I can easily pass to immediately create a "sub-tarball" from an existing tar archive? This is because some tarballs are too large do this

Extract one by one -> Tar with --delete-files option

1 Answer 1


First, extract the file from the archive. Then to delete the file, tar has a --delete option which will delete a file from the archive:

tar xf tar-file file-to-extract
tar f tar-file --delete file-to-extract

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.