1

I have a zip file: foo.zip.

The zip file extracts to:

- foo/
  - hello.txt
  - world.txt

What command do I issue to extract the files hello.txt and world.txt to the current directory rather than to the subdirectory foo. I could use the cp command but I want to do this all in one go.

1

Try:

$ unzip -j foo.zip

The -j option:

-j junk paths. The archive's directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one).

1
unzip -j foo.zip 

-j = junk paths. The archive's directory structure is not recreated; all files are deposited in the extraction directory

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.