3

I want to extract only a specific file type using unrar.

With unzip command I can extract all archives with a specific extension.

unzip "$FileName" *[.txt,.TXT]

How can I do the same with unrar? Do I need to iterate through every file?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
DarkXDroid
  • 219
  • 2
  • 9

1 Answers1

3
unrar x "$FileName" \*.txt \*.TXT

In bash you can also use:

unrar x "$FileName" \*.{txt,TXT}

Bash transforms this to the former form.

user2683246
  • 615
  • 6
  • 9