Thursday, February 24, 2011

Linux Usage: batch unzip all rar files

If you have a bunch of rar files under Linux and you need unrar all of them. This is quite a trouble. First of all, in the past Linux doesn't have rar tools. Fortunately, this is available right now so that we can process rar under Linux.

Now, the problem is how to handle lots of rar files. One way is to using Xwindows environment. You may use your mouse to select all files and right click uncompress. The other way is to use command:
$ for f in `ls --color=none`; do rar x $f; done

It loops through all files under current directory and pass it to rar program to extract the rar file. rar is the program name, x is the parameter meaning that this is a extraction and $f is the file name

No comments:

Post a Comment