PDA

View Full Version : Unrar/unzip (Linux question)



Myth
22-07-2007, 04:17 PM
While we chatting linux at the moment... something I tried doing and got lost with recently:
how to unrar/unzip a password protected file, and also, how to rar/zip a file and adding a password?

I know both apps have man pages, but I still couldnt get it to work. Help :help:

Speedy Gonzales
22-07-2007, 06:14 PM
Cant say I've seen a zip or rar file while I've been using Linux (Ubuntu).

I think most of the files I dl were gzip, tar, or deb

And most of these I just selected the file / right mouse and you could select a program to extract it.

Myth
22-07-2007, 06:48 PM
I found out on IRC (Freenode) half the answer (how do I unrar a file with password). The answer:
unrar x filenameUnrar will automatically ask for the password

Jen
22-07-2007, 08:25 PM
You mean:

urar e filename.rar

For the zip files, I imagine it will be the same. To add a password to a zipped file you need to use the -P switch.

Myth
22-07-2007, 10:26 PM
You mean:

urar e filename.rar

For the zip files, I imagine it will be the same. To add a password to a zipped file you need to use the -P switch.I was told to use the x switch. Just tried on a sample file the 'x' and the 'e' switches. 'e' just extracted the files, 'x' created a new dir and extracted to that dir

Graham L
24-07-2007, 02:19 PM
Probably all uncompressors will have the "t" option. That's "test", and will complain about any problems. It will also tell you the size and name of all files in the archive file. It's very useful. (I always use the "v", verbose, option too.

Normally, they won't "create a new directory" and uncompress into it. They will create a directory if the creator compressed a directory ( often with a recurcsive option) . ;) If the creator created the archive with a file specification something like "*", inside a directory, you will get all those files (messily) in your current directory when you uncompress it. :(

BTW, any decompresson, tar especially, which has an "f" (file) option has to have the f as the last option. It's interpreted as "use the file which immediately follows this f character". Sometimes people wonder why it keeps complaining that there's no such file to a command like tar xfv fred.tar . Every so often that catches me.

Myth
24-07-2007, 06:20 PM
Oops yeah, forgot about tar :blush: