How to move files from one dir to a
|
Original Message
|
Name: nkbeet (by nk.mtnl)
Date: June 17, 2008 at 08:54:29 Pacific
Subject: How to move files from one dir to aOS: UNIXCPU/Ram: SERVERModel/Manufacturer: IBM |
Comment: Dear Friends, I have a directory named tech, there are many files with *.uni extensions in this directory.The files with *.uni are continuously coming in tech directory.In tech directory, there is one directory named best. Now i want to move the files with *.uni extensions in this best directory. How can i do that. Please suggest a script in UNIX for this. NAVIN KUMAR
Report Offensive Message For Removal
|
|
Response Number 3
|
Name: nails
Date: June 18, 2008 at 09:06:19 Pacific
|
Reply: (edit)You must be trying to move a very large number of files to get a "arguments too long" error. Generally, you can get around the "arguments too long" problem by using a combination of the find/xargs command. Read about it in this online article, "Using the xargs Command": http://www.unixreview.com/documents...
You can probably do something like this: # untested untested untested cd /pathto/tech find ./ -type f -name "*.uni" -print | xargs -l56 -i mv -f {} ./best I suggest you read the article. I see another potential problem with having directory "best" right below the current directory. The find command probably will probably find those "uni" files.
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: nails
Date: June 23, 2008 at 11:36:04 Pacific
|
Reply: (edit)You'd get more help if you posted WHY it didn't work. Also, asking the same question in a different thread won't do you much good either.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: