1

In one of my applications a user can upload images and archives (ZIP, RAR). When an archive is uploaded, it should be extracted. However, some users will upload archives that contain files in a variety of subfolders (within the archive)

What i am looking for is therefore a tar command that will extract ALL the files from within the archive into one single folder, no matter what the structure of the archive is.

Can this be done with a single command? And if yes, what would that command be?

SquareCat
  • 5,699
  • 9
  • 41
  • 75

1 Answers1

2

Can this be done with a single command?

No, tar does not support the -j flag like unzip does, or provide any alternative flag.

Checkout the following alternatives:
TAR – Extract discarding directory structure

Community
  • 1
  • 1
Anne
  • 26,765
  • 9
  • 65
  • 71