Ubuntu – How to extract a zip file to a specific folder

archivedirectorypermissionszip

I have a zip file that I need to extract into another folder. When I set up extraction to said folder it says "permission denied". I've read here how to log into a terminal as root and superuser but can't find anything to help me.

I need to extract a file from my Downloads directory to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins.

Please explain how to extract a zip file to the correct folder.

Best Answer

We'll extract to a different folder to be sure that permissions aren't in our way:

  1. Open a terminal (Ctrl+Alt+T should work).

  2. Now create a temporary folder to extract the file:

    mkdir temp_for_zip_extract
    
  3. Let's now extract the zip file into that folder:

    unzip /path/to/file.zip -d temp_for_zip_extract
    

You should now have the contents of your zip file temp_for_zip_extract and can copy them into the desired folder.

If you can't copy the files to your folder, then check the permissions on your target folder.

The path to the downloads folder depends on what you used to download it to, try ~/Downloads. If you can't find it, then try this in a terminal:

cd ~;  find -name 'filename.zip'

You can also use a file manager, of course. There is Nautilus, Nemo, Thunar and many more, depending on your environment. Start the file manager and double click on your zip file, just like you would do in Windows.

Related Question