Finding certain files

Finding certain files

am 25.08.2005 06:32:11 von Shabam

I am trying to find files on my system that match this type of pattern:

keyword1-keyword2-keyword3-keyword4.html

I'm trying to find accounts on the system set up by search engine spammers,
who keep creating/uploading files with these types of names. Please stick
to the topic. This isn't the place to discuss the why, who, where, how. I
am just trying to locate the files and remove them. Thanks!

Re: Finding certain files

am 25.08.2005 06:45:47 von cfajohnson

On 2005-08-25, Shabam wrote:
> I am trying to find files on my system that match this type of pattern:
>
> keyword1-keyword2-keyword3-keyword4.html
>
> I'm trying to find accounts on the system set up by search engine spammers,
> who keep creating/uploading files with these types of names. Please stick
> to the topic. This isn't the place to discuss the why, who, where, how. I
> am just trying to locate the files and remove them. Thanks!

man locate

--
Chris F.A. Johnson
============================================================ ======
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress

Re: Finding certain files

am 25.08.2005 07:08:00 von Shabam

> man locate

Perhaps my question wasn't clear enough. I have been using locate to find
files. However, what should I use as a pattern match? Most times it's one
keyword followed by a "-" with anotehr, etc. usually up to 5 keywords, then
".html".

Re: Finding certain files

am 25.08.2005 21:25:10 von Jim Gibson

In article <3o-dnVjhiMCszJDeRVn-2A@adelphia.com>, Shabam
wrote:

> > man locate
>
> Perhaps my question wasn't clear enough. I have been using locate to find
> files. However, what should I use as a pattern match? Most times it's one
> keyword followed by a "-" with anotehr, etc. usually up to 5 keywords, then
> ".html".
>

In Perl, you can match key1-key2-key3-etc.html with the regular
expression

m/(\w+-)+\.html/


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---

Re: Finding certain files

am 25.08.2005 23:42:57 von James McIninch

find / -name \*.html | egrep '[^\-]-[^\-]-[^\-]-[^\-]'

Shabam wrote:

> I am trying to find files on my system that match this type of pattern:
>
> keyword1-keyword2-keyword3-keyword4.html
>
> I'm trying to find accounts on the system set up by search engine
> spammers,
> who keep creating/uploading files with these types of names. Please stick
> to the topic. This isn't the place to discuss the why, who, where, how.
> I am just trying to locate the files and remove them. Thanks!

--
Remove '.nospam' from e-mail address to reply by e-mail

Re: Finding certain files

am 26.08.2005 09:49:03 von noi

On Wed, 24 Aug 2005 21:32:11 -0700, Shabam thoughtfully wrote:

> I am trying to find files on my system that match this type of pattern:
>
> keyword1-keyword2-keyword3-keyword4.html
>
> I'm trying to find accounts on the system set up by search engine
> spammers, who keep creating/uploading files with these types of names.
> Please stick to the topic. This isn't the place to discuss the why, who,
> where, how. I am just trying to locate the files and remove them. Thanks!


My post didn't show up in my newserver so I suggested:

$ find / -iname "*keyword1*html" -o -iname "*keyword2*html" -o -iname
"*keyword3*html" -o -iname "*keyword4*html" -type f -exec rm {} \;

## or being safe
#!/bin/sh

find / \( -iname "*keyword1*html" -o -iname "*keyword2*html" -o -iname
"*keyword3*html" -o -iname "*keyword4*html" > /tmp/delete_these.ans

tar --remove-files -zcvf /tmp/spamcrap$(date +%y%j).tgz -T
/tmp/delete_these.ans