[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: locales problem / grep question



* Clive Standbridge <sink@ghaary.connectfree.co.uk> [20030319 14:27 PST]:
> By the way, recursively searching from / will search all files on any network file systems you have mounted, which can take ages. If this affects you, you could try something like
> 
> find / -xdev -type f | xargs -r grep -H -e '-\*-\*-medium-r-normal--14-\*-\*-\*-c-\*-iso8859-15'
> or
> find / ! -fstype nfs -type f | (etc.)

Wouldn't it be better to make use of find's -prune, something like

find / -fstype nfs -prune -o -type f -print0 | xargs -0 ...

The xdev one should be fine though.  (also, -mount is a synonym for
-xdev).  Without using -prune, the second find command you give would
still examine every file on all the nfs filesystems, just not pass them
all to grep.  Using -prune, find won't recurse down directories if they
match '-fstype nfs'.

Also, I've gotten into the habit of using -print0 with -0, since having
been bitten by filenames with spaces (of all things!).

Funny how when windows 95 suddenly got the ability to do more than 8.3
filenames, including spaces, they got so excited about it that they put
a space in every damned thing.  And billy boy started calling everything
"my this" and "my that", and suddenly my files started sitting right
there on my desktop, next to my computer, instead of inside it
somewhere.  At least the system was consistent: it consisted entirely of
equally dirty, dirty hacks.

Then I put Debian on (not next to) my computer.  Suddenly it was doing
way more than I ever thought it could, including getting along happily
with all of the windows and macintosh machines on the dorm's network.
And I had a filesystem, a shell, and utilities that could handle
filenames with spaces, but that all knew better =)

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."  --Benjamin Franklin

Attachment: signature.asc
Description: Digital signature


Reply to: