Re: Find every instance of hostname

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

 



On Sat, 2006-08-26 at 07:48 +0100, Anne Wilson wrote:
> I have a small problem on my laptop which springs from the sender of an email 
> being set as logwatch.localhost.localdomain.  I have so far been unable to 
> find which config file needs editing to get the correct hostname, so I'd like 
> to be able to search this box, where everything is fine, for config files 
> that contain the box's hostname.  I could then check the list against the ones 
> on the laptop.
> 
> It should be simple enough to do using find and grep, but I can't get a 
> command that gives me the output I need.  How can I do it?

Hi Anne.

Craig gave you the right places to look, but to answer your original
question ...

This will find all ext3 files on your system and search them
for your hostname and print out the file names that contain it.

As root:

# find / -type f -fstype ext3 -exec fgrep -l "hostname" {} \;

It will take some time.

You can play various games with find's commandline args to exclude
certain directories, do conditional searches, limit the search to a
particular filesystem, &c.

Worth spending the time studying its man page. One of the most useful
commands in unix-dom.

Don't use your fully qualified hostname unless your system name is
some really common or short name.  Sometimes it appears in system
files unqualified.


P.S. As you can see from previous e-mail, I'm finally running FC-5
     Thanks for directing me here those many months ago. :-)

-- 
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