0

I'm new to Linux and still don't know much, so this problem may sound a bit ridiculous. I have a folder with a lot of .tar files, and I wanted to simultaneously extract all of the files inside the .tar files to the same folder. Is there an easy way to do that?

1
  • You have all tar files in the same folder, and want to extract them all at once in the same folder? Or do you want that all files in the tar end up in the same folder, even if they are stored in folders inside the tar? Please clarify. For simultaneously extracting several tars in a folder, there is the for .... do loop.
    – vanadium
    Mar 26, 2021 at 7:55

2 Answers 2

0
cat *.tar | tar -xvf - -i

Run the above command from inside the folders which hold the tar files.

0
0

To clone copy from a location say (/home/test) to another tree /opt/backup..

tar cvfC - /home test | tar xvfC - /opt/backup

Or if you want to copy files from a remote system to your local..

ssh test@remote.local tar cvfC - /home/ test | tar xcfC - /opt/backup

Pipes are very useful..

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.