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)

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux