5

I'm trying to install jstock to the /opt directory. I'm getting the below error.

  1. jstock is in the ~/Downloads directory.
  2. The file name is correct.

Kindly guide.

navjeet@navjeet-Lenovo-G50-80:~/Downloads$ sudo unzip jstock-1.0.7.17 bin.zip -C /opt 
[sudo] password for navjeet:  
Archive: jstock-1.0.7.17-bin.zip  
caution: filename not matched:  -C 
caution:filename not matched:  /opt 
navjeet@navjeet-Lenovo-G50-80:~/Downloads$

Note: bin.zip and -C are separated by space, though it looks otherwise.

6

Took me a few minutes to see what you were doing wrong. You are using tar syntax for unzip and they aren't compatible. You want to run this:

sudo unzip -d /opt/ jstock-1.0.7.17-bin.zip 

For tar the syntax is tar xf file.tar -C dir whereas for unzip it's unzip -d dir file.zip

  • It worked wonders! kudos to you and thanks a lot.. Meanwhile i would like to know more about the differences of tar and unzip. – EetSandhu Nov 27 '16 at 14:01
  • @Krishtopher can i use tar to unzip (or untar , if that sounds correct) a .zip file ? – EetSandhu Nov 27 '16 at 14:02
  • Nope I just tested tar doesn't support .zip files, it does support .tar.gz and .tar.bz2 files though. – Kristopher Ives Nov 27 '16 at 14:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.