Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: TAR question

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    TAR question

    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


  2. #2
    Linux User
    Join Date
    Jan 2007
    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
    the sun is new every day (heraclitus)

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    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.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts