Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2006-01-12, 12:07 AM   #1
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
Need a ss search and delete script

Does anyone know of any server side script that will search for and delete files of a certain type or name? It would make my life a hell of alot easier for a certain task I have in mind. Any help would be greatly appreciated.
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Old 2006-01-12, 03:00 AM   #2
Chop Smith
Eighteen 'til I Die
 
Chop Smith's Avatar
 
Join Date: Apr 2003
Location: Mississippi
Posts: 2,168
Send a message via ICQ to Chop Smith
I am sure that either cd34 or Cleo post a link to a script months ago. I can not find it by searching. If so, I am sure they will give you an answer in the AM
__________________
Chop Smith is offline   Reply With Quote
Old 2006-01-12, 04:31 AM   #3
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
find . -type f -name \*.wmv -print | awk '{ print "rm \"" $1 \"" }' | sh

that will delete them if they include spaces, (, ), and other punctuation characters.

you could use xargs, but, if the list is long enough, xargs will say, too many arguments.

index4\*.html (would get rid of all files starting with index4 and ending with .html)

needs the \ in there.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2006-01-12, 11:54 AM   #4
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
Thanks a bunch Chop and cd34.....
Before you answered cd34 I I did find the following: find /path/to/dir -iname "*.txt" -exec rm {} \; which seems to work well as well. Thanks again!
__________________

Submissions Wanted!
CelticTiger is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:44 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc