Help using find to extract different types of rar files
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Help using find to extract different types of rar files
Hi my scenario is i have a working directory with several directories within it all containing different types of rar archives like:
Quote:
.part1.rar, .part01.rar, .part001.rar, .rar
So far my command will search the current directory and all directories within that directory looking for .rar archives whilst ignoring any directory called 'Test' and then extract JUST the files with the extensions ext1, ext2, ext3 to the previous directory and it's working quite nicely so far (although I'm sure you can point out several things you could change to improve it or do it the 'correct way' lol)
Problem is like I've said i need to add support for different rar types again:
Quote:
.part1.rar, .part01.rar, .part001.rar, .rar
Now the first three 'part' types aren't a problem and can be easily added to the command but adding .rar will mean it'll extract EVERY file in a (for example) .part1.rar set
How do i add all 4 types of archives to the command without it conflicting?
rar archives like:
.part1.rar, .part01.rar, .part001.rar, .rar
(...)
i need to add support for different rar types again:
.part1.rar, .part01.rar, .part001.rar, .rar
The two file type lists are identical. Is that a typo?
Quote:
Originally Posted by steve51184
Note this need to remain 1 line
Why?
And easy, anyway. If the solution requires several commands, put them onto the same line by separating them with semicolons.
There are really only two types, *.partXX.rar are multi volumes archives and *.rar are not. I agree with John VV that the multi volume files are oddly named but we do not know how they were created. If the OP adds the *.rar to the command it will try to unrar the *.partXX.rar that are not the first file in the archive which will fail.
Another possible multi part naming scheme is xyz.rar, xyz.r01 xyx.r02... Not sure that lxsplit will work. I expect the first file in the multi-volume has a file count and combining them into one might cause corruption.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.