![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Searching in VI | andyblaylock | UNIX for Dummies Questions & Answers | 1 | 11-28-2007 05:32 PM |
| searching for $ character | MizzGail | UNIX for Dummies Questions & Answers | 4 | 01-05-2006 08:21 PM |
| Searching a directoy | gumsun | UNIX for Dummies Questions & Answers | 3 | 01-05-2006 03:18 PM |
| searching searching | tony3101 | Shell Programming and Scripting | 3 | 06-04-2004 08:50 AM |
| searching for { | yotoruja | Shell Programming and Scripting | 4 | 11-03-2003 07:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Searching and deleting
Hi Guys
I hope this is an easy one, is it possible to write a unix bash script, (or just a command) to search for wildcards and then delete that wildcard once it is found, and the search is performed over a whole directory tree. eg it searches for *.ppp then once it finds them it deletes ???.ppp. Sorry I'm a not too clued up on unix yet so any help would be great thanks heaps |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Enter in the "root" of your directory tree and then:
Code:
find . -name "*.txt" -exec ls -l {} \;
Code:
find . -name "*.txt" -exec rm {} \;
|
|
#3
|
|||
|
|||
|
Thankyou so very much, that was exactly what I wanted
|
|
#4
|
|||
|
|||
|
Sorry last question
Is it possible to perform that above command but exclude a directory - say I did a search with in their home area but wanted to exclude the library directory how would I do that? Thanks heaps |
|||
| Google The UNIX and Linux Forums |