remove a 350 files in one shot


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remove a 350 files in one shot
# 1  
Old 09-17-2008
remove a 350 files in one shot

i have a dir called logs. In it i have some 350 files how to move all those files from directory logs to a new dir called archive

I want to do it in single shot

Below the command i m trying but not getting

find . -name "CurrentCollector*" -exec mv {} archive \;
--------------------------------------------------------------
# 2  
Old 09-17-2008
The command looks fine. How is it failing?
# 3  
Old 09-17-2008
Quote:
Originally Posted by ali560045
find . -name "CurrentCollector*" -exec mv {} archive \;
For safety add the path to directory and the "file" type on your find command:
Code:
find /path/to/dir -type f -name "CurrentCollector*" -exec mv {} /path/to/archive \;

Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to zip up a series of log files in one shot?

Hi, I'm trying to zip up the first half year's application logs into one zip file. The logs are in the format of log.2011-01-01 to log.2011-06-30. I tried to use this command at ksh: zip logs.jan-jun2011.zip *2011-01* *2011-02* *2011-03* *2011-04* *2011-05* *2011-06* It works. However, I... (4 Replies)
Discussion started by: hyang
4 Replies

2. Shell Programming and Scripting

Deleting both hidden and regular files in a single shot

How to delete both hidden (. dot files) and regular files available in a directory in a single shot (just one pass instead of two rm commands)? The following are not helping: rm .* (or) rm \.* (or) rm .??* (or) rm * All these commands delete either hidden or regular files at one... (4 Replies)
Discussion started by: royalibrahim
4 Replies

3. Shell Programming and Scripting

To change the ownership at one shot

i have a directory in which i have Multiple files: Following are they==== -rw-r--r-- 1 root root 886 Jan 21 16:38 trunkn.xsd -rw-r--r-- 1 root root 244 Jan 21 16:38 trunknameCache.xml -rw-r--r-- 1 root root 1240 Jan 21 16:38 subscribercache.xsd -rw-r--r-- 1 root ... (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies

4. OS X (Apple)

Please look at this screen shot: How do I remove this lock icon?!

RESOLVED in the screen shot I'd like to remove the lock sandwiched between the spaces indicator and the monitor icon, how do I get rid of it? It locks the screen and I cannot remember how it came to be http://guptaxpn.com/tmp/lock_icon_screenshot.png Thanks for your help! (3 Replies)
Discussion started by: guptaxpn
3 Replies

5. Shell Programming and Scripting

My first shot at variables

Okay, so im setting up a script to start my internet dependent scripts once I am connected to the net. It got complicated because of the different networks I frequent but it goes something like this: n=1 iwconfig wlan0 > wireless.txt m= grep -c MGHS /home/jake/Scripts/wireless.txt o= grep -c... (7 Replies)
Discussion started by: arcnsparc
7 Replies

6. BSD

Error -350

Hi All, When ever am rying to connect to the database using isqlrf from the command prompt i get the following error Error -350 is Index already exists on column. What could be the possible reason and a solutin for this ? AM using freeBSD Thanks in advance (0 Replies)
Discussion started by: jisha
0 Replies

7. UNIX for Dummies Questions & Answers

unix screen shot

i would like to see an unix screen shot if anyone could take a screen shot of unix (7 Replies)
Discussion started by: royal
7 Replies
Login or Register to Ask a Question