For a GUI I'd say the easiest way is a nautilus script. The main line of which would be:
unzip "$item" && trash "$item"
It works in bash/dash just as easy. In nautilus the whole thing would look like this:
#!/bin/bash
# Nautilus script to unzip and then remove a zip archive.
# Nautilus script usually go in "$HOME/.gnome2/nautilus-scripts"
IFS='
'
for item in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
if [ -n "$(file -b "$item" | grep -o 'Zip')" ]; then
unzip "$item" && trash "$item"
# use trash instead of rm to move them to trash
# (trash-cli package installed)
fi
done
As you note in the comments you now know how to change directory with your script, I'll explain the situation with zip regarding relative paths.
It is probably easiest to open terminal and cd
to kit123
; you have to make the target directory your working directory- you can't run the command from the base of your home directory or it will pick up all the paths of /home/$USER/..
If you use the -j
option, it will strip out all paths, as there isn't really an equivalent of the tar option --strip
with which different levels of path removal can be specified.
So please cd to your target directory (kit123
) and enter:
zip -r kit123.zip *
This will recursively (-r
) preserve all (*
) files and directories of files in the current directory (kit123
), and as relative paths (-p
) are preserved automatically unless the -j
option is present, the directory structure will be as you wished. Kit123
and subfolders (kitpart1
) with their own files will be present:
kit123
kitpart1
file.xcf
anotherfile.xcf
kitpart2
You can check the contents of the zip file with unzip -l zipfile.zip
.
For more information on the other options available for zip
, see man zip
and the Ubuntu manpage online.
Best Answer
A .zip file is an archive, so you can't install it, but can unzip or extract it - right click, select 'Extract here'. Call it installation if you like, but that's pretty much it. If you prefer the terminal way, then:
To run it
cd
to the installation directory, and then run./chrome
Needless to say, I'd strongly discourage using any unofficial version of Chrome. It could be unsafe, and your best bet is to get the real thing instead.