On 07-Feb-00 at 15:52:11 jschlst wrote:
> Try hostname -i that will output the local IP address.
> 
>> I'm try to sort out a (simple) way of determining the local hosts IP
>> address (not the 127 address, but the address used by the ethernet card
>> in my case) on linux and solaris systems. I know that ifconfig shows
>> this, and it can be grepped but is there a simple command that says
>> what the IP address is (like hostname gives the hosts name)? I can't
>> think of one and couldn't find one.
> 
Almost :-) This doesn't work under Solaris :-( 

Richard Adams <[EMAIL PROTECTED]> wrote:
>>ifconfig eth0 | awk -F addr: '{ print $2 }' | cut -f1 -dB
>
Again, almost :-) I should have added that I have IPX configured as well. So
the above gives me the IP address and the IPX addresses as well. However, as
said I think that ifconfig with grep (or awk or both!) will have to be the
answer.

Thanks,

John.

--------------------------------------------------------------------------
John Horne, University of Plymouth, UK             Tel: +44 (0)1752 233914
E-mail: [EMAIL PROTECTED]
Finger for PGP key: [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to