views:

15

answers:

1

i want to find every log file named 'justjoe_log', on an apache server. I want to delete them all. how do i do it ?

+2  A: 
locate justjoe_log|xargs rm -rf

You may want to just do locate first to avoid deleting data unintentionally.

Matthew Flaschen
+1 I was unaware of "locate" (I would have used "find").
Amit Kumar
Yes, locate is *much* faster, but it relies on indexing so it doesn't reflect changes since the last `updatedb` run.
Matthew Flaschen
which is typically run daily or weekly so it isn't often very up to date. nice comment!
Michael