Jak zjistit ip aresu

Martin `MJ' Mares mj na ucw.cz
Pondělí Březen 24 13:13:36 CET 2003


Hello, world!\n

> > jak ziskat ip adresu rozhrani eth0
> 
> hostname -i

To nebude fungovat, protoze vubec neni jasne, ze zrovna tato adresa bude
patrit rozhrani eth0.

Spohelivy zpusob by mel byt napriklad:

ip addr show dev eth0 | sed '/^ *inet.*scope global/!d;s/^[^0-9]*//;s/ .*//;s/\/.*//'

				Have a nice fortnight
-- 
Martin `MJ' Mares   <mj na ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
A jury consists of 12 persons chosen to decide who has the better lawyer.


Další informace o konferenci Linux