Hi all. I apologize if this is in an incorrect thread.
I'm working with an already existing TAR file and I'm trying to insert a file into a subfolder of the TAR archive. Is there a simple way to do this? I don't want to put it in the directory where the TAR is pointing and archive again because it is a long process to archive everything; I want to put it directly into the subfolder of the TAR.
I want to do something like: tar -cf test.tar:/subfolder text.txt
welcome to the forum
according to "man tar" you have 8 options, none of which do what you want.
the closest is -r, --append
append files to the end of an archive
As tpl said, you cannot do that directly, but you can append it to the end of the archive, and it will go into the correct folder if you do it properly.