Re: Find every instance of hostname

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

 



: On Saturday 26 August 2006 19:45, Dean S. Messing wrote:
: > Hi Anne.
: >
: Hi, Dean.  Good to see you finally made it! ;-)

Good to be here.  There appears to be lots of old Mandrake hands on
board here.  I just, finally, un-subscribed from "experts" yesterday.  The
total e-mails per day is down to about seven or eight.  Pitiful,
esp. given the golden days.  Just goes to show what bad management can
do in a very short time.  But this is Off Topic (big time).

:
<snip>
:
: > As root:
: >
: > # find / -type f -fstype ext3 -exec fgrep -l "hostname" {} \;
: >
: > It will take some time.
: >
: Time, I don't mind.  I suspect, though, that the 12,000 or so emails would 
: also be included.

Easily handled if the e-mail is all under one directory.  If so, then
(assuming the mail is in "/usr/foo/mail-under-here"

find / -path "/usr/foo/mail-under-here" -prune -o -type f -fstype ext3 -exec fgrep -l "hostname" {} \;

This is just a boolean expression. -o means "OR". 

"AND" is implicitly between all other arguments if no "-o" conjunction
is given.  So it says 

   if the current pathname is "/usr/foo/mail-under-here" then prune it
   from the search tree (i.e. don't search any deeper), "OR" do the
   stuff to the right of the "-o" which is what you were already
   doing.

: 
<snip>
:
: The really big problem, of course, is the difficulty in trying to prove 
: something does NOT exist.  All I can do is try to find likely files on this 
: working setup in the hope that I can match them to ones on the offending one.

With "find" you can prove it. If no filenames are printed then you
know that the "fgrep" search string does not appear anywhere in any ext3
filesystem (that is mounted) except possibly the ones you pruned.

Add the -i flag to fgrep in case you want to make the search
case insensitive.

Dean

(Signing off for the day)


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux