03-07-2002
Just answer your question about the {} braces.....
The braces become the result set from the find command....... so your rm {} will effectively do a "rm /dira/cor /dirb/core /dirc/core"
Replacing the {} with all returned arguments from the find query. So for example if you wanted to cp the result of your search to a certain directory you could use:
find . -name my_file -exec cp {} /export/home/all_my_files/ \;
This would copy the file it found on the file system to your specified directory. Obviously for this you could only do it for a single return.....as if find retrieves multiple instances (as with your core search) then you'd be in a world of pain.
If you want multiple things to be done...i.e. renaming the result files then you'd use the xargs command (RTM).
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
when ever i type it in it always looks like so
echo $file | sed 's/~/\
/g'
how can i get it on one line? (6 Replies)
Discussion started by: Optimus_P
6 Replies
2. Programming
I need to compile a file,but 'make' does
not work.please tell me how to use it or
need which tools? (3 Replies)
Discussion started by: dsun5
3 Replies
3. UNIX for Dummies Questions & Answers
I am kind of new with Unix and I really need some help. Can you please tell me what the 'whatis' command is? and what does it do?
Let's say that I have a file which I want to delete, what command will I need to use?
If I have a directory that I want to delete all files from what command do... (11 Replies)
Discussion started by: mischiefdemon
11 Replies
4. Shell Programming and Scripting
I wonder how I shall read the result below, especially 'what'
shown below.
The result was shown when I entered 'w'.
E.g what is TOP? What is gosh ( what does selmgr mean?)?
login@ idle JCPU PCPU what
6:15am 7:04 39 39 TOP
6:34am 6:45 45 45 TOP
6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies
5. UNIX for Dummies Questions & Answers
I asked a similar question earlier and got a very good answer but a new doubt came up. This is a few lines of a '/sbin/ifconfig' command on my PC:
RX packets:3781025 errors:0 dropped:0 overruns:0 frame:0
TX packets:1941909 errors:0 dropped:0 overruns:0 carrier:0
Does the RX and TX packets... (1 Reply)
Discussion started by: mint1981
1 Replies
6. UNIX for Dummies Questions & Answers
echo 'it's friday'
why appear the > (3 Replies)
Discussion started by: yls177
3 Replies
7. UNIX for Dummies Questions & Answers
I apologize is this is somewhere else but I did look....
Is there a command to goto position # x within the VI editor? I've seen where you can search for a particular char string but I need to go to position 200 within a record (tired of counting positions)...:)
Thanks in advance... (2 Replies)
Discussion started by: hedrict
2 Replies
8. UNIX for Advanced & Expert Users
Hi,
I am facing an interesting aspect of find command...
to be clear, we are running a small web server with oracle 8i database and Oralce9iAS on Sun E250 with Solaris 2.6
Over a period of time, the free memory ( displayed in 'top' utility ) drops down.. we could relate this to dedicated... (6 Replies)
Discussion started by: shibz
6 Replies
9. UNIX for Advanced & Expert Users
Somehow someone created a file named '-ov' in the root directory.
Given the name, the how was probably the result of some cpio command they bozo'ed.
I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies
10. Shell Programming and Scripting
Hopefully this doesn't come off as too much of a "newbie" question or a flamebait. But I have recently begun working with a Sun Solaris box after having spent the past five years working with RedHat. From what i can tell, thing look fairly similar and the 'man' command is some help. But I've... (7 Replies)
Discussion started by: deckard
7 Replies