![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 6 | 10-25-2008 01:37 PM |
| question on find and remove command | arunkumar_mca | UNIX for Dummies Questions & Answers | 1 | 12-11-2007 01:54 AM |
| question about find command | hnhegde | UNIX for Dummies Questions & Answers | 4 | 10-26-2006 04:00 PM |
| Find command question | negixx | Shell Programming and Scripting | 6 | 07-08-2005 12:43 PM |
| command find returned bash: /usr/bin/find: Argument list too long | yacsil | Shell Programming and Scripting | 1 | 12-15-2003 06:38 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
'find' command question
my solaris text talks about the 'find' command... it further goes to talk about an "action" used with the find command.
I am completely confused as to what the {} do with the find comand. the explanation is this: "A set of braces, {}, delimits where the file name is passed to the command from the prceding expressions." Now what does this mean? It makes no sense to me. an example they give is the following: $ find ~ -name core -exec rm {} \; |
|
||||
|
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). |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|