Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells, Data

A Wrapper Script for unrar

Submitted by on October 21, 2021 – 11:51 am

Just a straightforward wrapper script for the unrar command that allows extracting specified filetypes from multipart archives while utilizing all available CPU cores.

Seriously, who memorizes unrar command-line options? This little script will locate all *.rar files in the current folder. It will then extract specified filetypes from single- or multi-part archives using all the CPU cores on your system.

#!/bin/bash
find . -type f -regextype posix-extended \
-regex '^.*(part(0)?1|[[:alpha:]]|[@_\-\.;\:\^\%$\#\!=+~`])\.rar$' -print0 | \
xargs -0 -n1 -P$(grep -c proc /proc/cpuinfo) -I% unrar e -kb -o+ % \*.{pdf,epub,mkv,avi,mp4,mp3,flac}

 

Print Friendly, PDF & Email

Leave a Reply