Add new-file.txt
to the existing archive files.tar
.
You can use this short tar command.
tar -rvf files.tar new-file.txt
Or this more verbose tar command.
tar --append --verbose --file files.tar new-file.txt
If you need to add multiple files to an exsiting archive, simply chain the filenames.
tar -rvf files.tar new-file.txt another-file.txt yet-another-file.txt
-r
or --append
tells tar to append to an existing archivev
or --verbose
tells tar to produce verbose outputf
or --file
tells tar that the next parameter will be the tar file to create, extract, append to, list, etc.