I am using kUbuntu v20.4 and want to set
Unpack separate subdir checked by default
Motivation:
It often happens that I unzip a zip in my Downloads folder and then I have a bunch of files unzipped in that beside many other downloaded files.
I want the default position to be that this zip will be unziped in a new folder or each archive is unzipped into a separate folder.
If I check it manually it’s ok for me, but if I forget then it’s a mess of files around and difficult to repair. So to have it by default or that the GUI can remember the last config (much better in my opinion) it would be very helpful.
How is the default option configured?
unzip
has a-d {dir2unxip}
There is no automatic way to do this through a setting. You will have to supply a directory using the
-d
option. The command will ask to overwrite if the dir exists and if you did not force it.The best you can do is to create an alias for
zip
that changes it tozip -d
so you are told to supply a directory. But that would mean you HAVE to supply the zip file itself as the next argument and need to remeber to use this new function.You would type ...
and the contents get created in subdirectory
2
Automatic system assuming using defaults to unzip into subdirectories
You can make an automatic system assuming that you unzip using defaults, simply
unzip filename.zip
using the following shellscript and put it in path before theunzip
, for example as/usr/local/bin/unzip
.You should also run
source ~/.bashrc
in order to make the current bash (terminal window) aware of the local unzip script.This assumes that you are happy with subdirectories with the name of the zipfile (minus
.zip
).Try the shellscript method in a test directory before doing it where you have real data, so that you see that it is doing what you want it to do.