unable to unzip to opt directory

8,781

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

Share:
8,781

Related videos on Youtube

EetSandhu
Author by

EetSandhu

Updated on September 18, 2022

Comments

  • EetSandhu
    EetSandhu over 1 year

    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.

  • EetSandhu
    EetSandhu over 7 years
    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
    EetSandhu over 7 years
    @Krishtopher can i use tar to unzip (or untar , if that sounds correct) a .zip file ?
  • Kristopher Ives
    Kristopher Ives over 7 years
    Nope I just tested tar doesn't support .zip files, it does support .tar.gz and .tar.bz2 files though.