Lawrence Bowie wrote:
for i in `ls -1 *.rar`; do unrar x $i; done (assumes BASH)
or
ls -1 *.rar | xargs -i unrar x {}
Both can fail for this reason: summer@Phascogale:~> \ls -1 SharePrices/2*2 bash: /bin/ls: Argument list too long summer@Phascogale:~> so something like this: find SharePrices/ -maxdepth 1 -type f -name 2\*2 rather than the ls command above.
David Crouch wrote:
HI all.
I used to know how to do this, but apparently I've forgotten :( I know I can use a for loop to process all the files in a directory, but I can't for the life of me remember how to do it. I have a bunch of archived files that I want to unarchive. I've tried for I in *rar:do 'unrar x $I.rar':done, but that doesn't work and I can't seem to find the right man page with the syntax. Any help?
Appreciated in advance.
-- David Crouch