Инструменты пользователя

Инструменты сайта


doc:os:freebsd:scripts:how_can_i_know_ip_address

Узнать IP адрес из скрипта

Готовый код:

ifconfig  | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'

В Линуксе можно так:

ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

TAG:

Обсуждение

Ваш комментарий. Вики-синтаксис разрешён:
Error: Call to undefined function each()

Error: Call to undefined function each()

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the captcha plugin.

More info has been written to the DokuWiki error log.