On Mon, 2003-02-24 at 12:17, Michael Ryan Byrd wrote:
> So I decide I want to show all the index.html files on my system with:
> 
> ls -alR |grep "index.html" 
> 
> (I could have used 'Find . -name "index.html" -print', but anyway.)
> 
> The problem is that this command is not executed as root, so I'm going to get a
> bunch of errors like:

Two solutions have already been given. However, I personally think the cleanest is

ls -alR 2>/dev/null | grep "index.html"

Unless there's a reason to send errors through the pipe and burn CPU
processing them, why not kill it right away?  As for the other, it's
only eating grep's stderr but you want get rid of the ls' error
messages.


-- 
Stuart Jansen <[EMAIL PROTECTED]>

#define FALSE 0 /* This is the naked Truth */
#define TRUE  1 /* and this is the Light   */ -- mailto.c


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to