Created
October 11, 2019 05:56
-
-
Save theagoliveira/1aca16cde58250b9aec82c3afabb10c6 to your computer and use it in GitHub Desktop.
Extract every rar file inside a directory and compress as a zip file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Thiago Cavalcante | |
# github.com/theagoliveira | |
find . -maxdepth 5 -mindepth 1 -name "*.rar" -type f -execdir unrar x -ad {} \; -exec bash -c 'f="{}"; f=${f::-4}; 7z a -tzip "$f.zip" "$f"; rm -rf "$f"' \; -exec rm -f {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment