Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unrar Multiple Files with Command Post 302234480 by Annihilannic on Tuesday 9th of September 2008 08:00:09 PM
Old 09-09-2008
unrar e extracts files to the current directory, not one specified on the unrar command-line.

Try this:

Code:
for i in *.rar
do
  mkdir "${i/.rar}"
  cd "${i/.rar}"
  unrar e "../$i"
  cd ..
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Perform a command to multiple files

How do I perform a command to multiple files? For example, I want to look at all files in a directory and print the ones that do not contain a certain string. How do I go about doing this? (4 Replies)
Discussion started by: mcgrawa
4 Replies

2. Shell Programming and Scripting

Splitting input files into multiple files through AWK command

Hi, I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below for file in *.txt do grep -i -h "value1|value2" $file > $file; done. My requirment is more input values needs to be given in grep; let us say 50... (3 Replies)
Discussion started by: arund_01
3 Replies

3. Shell Programming and Scripting

how to use multiple files in sed with w command

i have a command like : sed -n 's/^* /&/w even' <file if i want to write to multiple files like sed -n 's/^* /&/w zero two three' < file its not working it is taking "zero two three" as a single file i want to write to 3 seperate files . pls can anyone help me (2 Replies)
Discussion started by: santosh1234
2 Replies

4. Shell Programming and Scripting

unrar multiple files with password

The problem: how to unrar multiple rar files with known password This works fine: but how to/what to implement to prevent asking me for password each time Have tried: but it wont work. Any help appreciated. (2 Replies)
Discussion started by: vampirex
2 Replies

5. Shell Programming and Scripting

using mv command for moving multiple files in a folder

Hi, I have a requirement where I need to move Bunch of folders containing multiple files to another archive location. i want to use mv command .I am thinking when we use mv command to move directory does it create directory 1st and then move all the files ? e.g source... (4 Replies)
Discussion started by: rkmbcbs
4 Replies

6. Shell Programming and Scripting

SED command using multiple input files

What is the syntax to use multiple input files in a SED command. i.e. substitute a word with a phrase in every file in a directory. for every file in /usr/include that has the word "date" in the file grep -l '\<date\>' /usr/include/*.h find each occurrence of the word "time" in the file &... (3 Replies)
Discussion started by: sheoguey
3 Replies

7. Shell Programming and Scripting

finding multiple files using find command

I am trying to search for 2 files using the find command as below find -name file1.txt -a -name file2.txt It doesn't give a result although the files exist in the folder, however when i try the following find -name file1.txt -o -name file2.txt It does give me the result. ./file2.txt... (4 Replies)
Discussion started by: vivek_damodaran
4 Replies

8. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

9. Shell Programming and Scripting

unrar files

Hi, I have two .rar files on unix server. but how to unrar these files ?? (6 Replies)
Discussion started by: milink
6 Replies

10. Shell Programming and Scripting

Inputting multiple files into one command

I am trying to read 30 files into a command. The first file contains 10 lines and goes into this part of the command as "x" /tmp/filearrange.sh $x The group of files (20 files, I call them variable $i) need to be the second argument in the command and they need to be read so that they are... (9 Replies)
Discussion started by: newbie2010
9 Replies
UNRAR(1)							   RAR archiver 							  UNRAR(1)

NAME
unrar - extract files from rar archives SYNOPSIS
unrar <command> [-<switch 1> -<switch N>] archive [files...] [path...] DESCRIPTION
This manual page documents briefly the unrar command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Commands and options described here are as of unrar 2.02. OPTIONS
After the program name comes a command and then optional switches with dashes before them. A summary of commands is included below. For a complete description, run unrar without options. e Extract files to current directory. l List archive content. p Print file to stdout. t Test archive files. v Verbosely list archive. x Extract files with full path. SWITCHES
NOTE: Every switch must be separated by a whitespace. You cannot put them together. -av- Disable AV check. -c- Disable comments show. -f Freshen files. -kb Keep broken extracted files. -ierr Send all messages to stderr. -inul Disable all messages. -o+ Overwrite existing files. -o- Do not overwrite existing files. -p<password> Set password. -p- Do not query password. -r Recurse subdirectories. -u Update files. -v List all volumes. -x<file> Exclude specified file. -x@<list> Exclude files in specified list file. -x@ Read file names to exclude from stdin. -y Assume Yes on all queries. AUTHOR
This manual page was written by Petr Cech <cech@debian.org> according to "unrar -h" for the Debian GNU/Linux system (but may be used by others). 02.11.1999 UNRAR(1)
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy