You are not logged in.

#1 2021-12-29 03:09:32

Valso
Member
Registered: 2021-04-22
Posts: 136

p7zip CLI - extracting archive's content in a dir with the same name?

Recently I downloaded some old games which were placed in rar files but for unknown reason fileroller can't open them (displays an error). So I did some reading on the internet and found that people were able to open rar files with p7zip CLI. But the problem with old games (usually PC Rip style) is that they have lots of files and if you extract them in a directory with other subdirs, that makes the ultimate mess. I wanted to extract the contents of the archive in a directory with the same name as the archive (if the archive is named "game1.rar", the contents to be extracted to a directory named "game1"). I tried using options -e and -x, then I tried using -x -r but p7zip keeps "throwing" all the files wherever it likes, without a target dir. At this point I'm guessing that my best bet would be using -x -o {Directory} as the p7zip help text suggests. However, I don't wanna have to manually type the target dir every time, so I'm hoping that there's something more... universal, so to speak, which I can type in order to instruct p7zip to extract the archive in a directory with the same name as the archive. That would be especially useful when the archive has a long name.

Last edited by Valso (2021-12-29 03:10:35)


RESIST OS GTK3 (customized Arch without pipewire), i7-12700F, RTX 3070 Ti 8GB, 64GB DDR5-4800 (OCed to 5200 MHz).

Offline

#2 2021-12-29 03:54:37

yochananmarqos
Member
Registered: 2020-02-05
Posts: 222

Re: p7zip CLI - extracting archive's content in a dir with the same name?

What was the error using file-roller? Do you have unrar installed? I don't think I've ever had an issue with multi-part RAR's.

Offline

#3 2021-12-29 07:28:38

Valso
Member
Registered: 2021-04-22
Posts: 136

Re: p7zip CLI - extracting archive's content in a dir with the same name?

Yes, I have unrar installed and the error was simply "unable to open this archive" or something like that - my system is in Bulgarian, so I'm translating to English here. And I can't be 100% sure, but I think this error appears only when the archive has been protected with a password.


RESIST OS GTK3 (customized Arch without pipewire), i7-12700F, RTX 3070 Ti 8GB, 64GB DDR5-4800 (OCed to 5200 MHz).

Offline

Board footer

Powered by FluxBB