How to extract a zip file to a specific folder?
Solution 1
We'll extract to a different folder to be sure that permissions aren't in our way:
Open a terminal (Ctrl+Alt+T should work).
Now create a temporary folder to extract the file:
mkdir temp_for_zip_extract
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.
Solution 2
Your targeted directory is owned by root (/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins
), so you cannot write to it as a normal user.
Instead of mucking around with permissions, you can use sudo
to unzip as the superuser.
sudo unzip ~/Downloads/whatever.zip -d "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins"
I suggest you do this to a temporary directory first to ensure the files are what you expect and will not damage/destroy your plex installation:
unzip ~/Downloads/whatever.zip -d /tmp/whatever
then cd /tmp/whatever
and verify that contents are what you expect. If so, then go ahead with the sudo
command I showed above.
Youcef
Updated on September 18, 2022Comments
-
Youcef over 1 year
I have this quora webpage as a sample
It does contain 4 "View Upvoters" buttons Using this code, I want to get all 4 button in order to click them one by one later.
upvoter_list = wait.until(EC.presence_of_all_elements_located((By.CLASS_NAME, 'AnswerVoterListModalLink')))
print(len(upvoter_list))
gives me 4, which is correct when I print the text of the first element ofupvoter_list
print(upvoter_list[0].text)
I get 'view upvoters' as a result but when I print the remaining, i get the empty result,
print(upvoter_list[1].text)
what is the problem?
-
Admin over 9 yearsAre you limited to command line? What folder are you trying to extract to? Is the extension
.zip
? -
Admin over 9 yearsyes the extension is .zip im trying to extract the zip file to plex media server plug ins ...its in my downloads folder but when i try and extract to new directory it says i dont have permission
-
Admin over 9 yearsInto which folder are you trying to extract it to?
-
Admin over 9 yearsvar/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins to be exact is where i want it to go
-
Andersson over 5 yearsI see only 2 buttons and text printed for both as expected
-
Youcef over 5 yearsNo, there is 4 view upvotes buttons, when you print the text of the first element of upvoter_list you get 'view upvotes', but for the remaining you get empty result
-
-
Tj Cooke over 9 yearsok now i guess im typing wrong pathname ....feel stupid asking this but what would be the default path to my downloads folder in terminal?
-
Tj Cooke over 9 yearsbasically i want to add a plug in to my plex media server i just need to add this bundle there so i can install channels to my server
-
Jetson Earth over 9 yearsSee my edit on how to find your file. I believe you only have a permission problem.
-
Tj Cooke over 9 yearsyeah its a permissions problem and having no luck finding it in terminal i can see it under files under my name /home/Downloads but cant find in terminal says no such file or directory
-
Tj Cooke over 9 yearsisnt there a program or something that will just unzip to appropriate folder with permissions already set?
-
Jetson Earth over 9 yearsAdded info on file managers
-
Tj Cooke over 9 yearsok i have opened it using file roller and that's where i get permission issues when extracting...can you recommend an easy quick file manager i can install and use?
-
Dan over 9 yearsOpen Nautilus as super user.
gksudo nautilus
-
Tj Cooke over 9 yearsThat did it! thanx so much it was baffling but its in and working as far as i can tell anyways lol
-
Peter Chaula over 6 yearsThanks. The option is on the right section of the command help. That's why I couldn't see it
-
Peter Chaula over 6 yearsI didn't find it again for the second time
-
Youcef over 5 yearsThanks for the code, what do i have to add in order to get the content generated by the click event? which is in this case the name of the upvoters
-
Youcef over 5 yearsNote that p.click () is giving me error code, element not clickable
-
Timo about 3 yearsfrom the docs (
man unzip
): The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive. -
Boris Verkhovskiy about 2 yearsI just get a directory with one directory (the old name) inside. How do I remove that level?
-
Boris Verkhovskiy about 2 yearsI end up with
/tmp/whatever/whatever
that actually has all the files. How do I remove that if I don't know the name of the secondwhatever
?