[NTLUG:Discuss] Re: Renaming a Linux host
Leroy Tennison
leroy_tennison at prodigy.net
Thu Jul 28 01:19:29 CDT 2005
Thomas Cameron wrote:
>On Sun, 2005-07-24 at 23:15 -0500, Leroy Tennison wrote:
>
>
>
>>I was afraid someone was going to say something to that effect, it never
>>seems to be that easy. BTW, I'm running into problems with 'grep -R
>><hostname> *' on Red hat 9. It never seemed to complete (waited an hour
>>on a 1.7GHz host with a 40GB HD which is 73% full). I then decided to
>>get a little omre sophisticated and do (at /)
>>
>>for i in `ll | grep ^d | awk '$0 ~ "dev" {next}; $0 ~ "proc" {next};
>>{print $NF}'`; do grep -R <hostname> $i; done
>>
>>but grep still ran out of resources in /var. Any ideas or, by the time
>>I get to /var, do I care?
>>
>>
>
>To change the hostname, edit /etc/hosts and /etc/sysconfig/network.
>
>To grep for a string in all the files under a directory, I usually use
>
>find /path -type f | xargs grep "foo"
>
>where "path" is the directory I want to search, and "foo" is the string
>I am looking for. It typically works for me.
>
>
>
Nice, much easier way of eliminating non-regular files. I'm trying it
right now (alittle surprised at some of the /proc ... files that are
considered 'regular').
More information about the Discuss
mailing list