• Magyar nyelv
  • Gábor Kum

    Kum Gábor
    Specialist in use of Linux, free and open-source software, and in security of bank payment technologies. Also interested in today's privacy challenges, low-bitrate communications, and building a house as a hobby. Lives at the biggest lake of Central Europe, Lake Balaton.

  • Other projects

    HELLOTUX
    Promoting free software all over the world. Free software merchandise from Europe, in partnership with the leading Linux distributions and free software developers.
    www.hellotux.com
     

    Education
    Teaching digital competences for children between ages 9 and 14. The goal is not understanding ancient software but understanding the digital future.
    www.fenyvesirefi.hu
     

    Consulting
    IT consulting and services for government institutions. GAFAM-free and GDPR compliant local and EU-based systems on the base of open source.

  • Magyar nyelv
Az IP-címünk lekérdezése scripttel

16 February 2012, 1:54 pm (Central European Time)

Ha szeretnénk megtudni, hogy mi az eth0 hálózati csatolóhoz tartozó IP-címünk, és csak azt szeretnénk kiiratni, mert valamihez használni fogjuk, itt a megoldás.

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

Az ifconfig eth0 kiírja a csatoló adatait.
De nekünk csak az a sor kell, amiben az IP van (ifconfig eth0| grep 'inet addr:')
Vágjuk le az IP-cím előtti, számunkra felesleges részt (ifconfig eth0 | grep 'inet addr:' | cut -d: -f2),
majd az azt követő szöveget is, és meg is van az IP-cím.

Természetesen nem csak eth0-val használható.

 

Be the first who leaves a comment!

Leave a comment!

Your name:

Your e-mail (kept private and will not be shown):

Comment:

Please type the word sweet here:

  • Gábor Kum

    Kum Gábor
    Specialist in use of Linux, free and open-source software, and in security of bank payment technologies. Also interested in today's privacy challenges, low-bitrate communications, and building a house as a hobby. Lives at the biggest lake of Central Europe, Lake Balaton.

  • Other projects

    HELLOTUX
    Promoting free software all over the world. Free software merchandise from Europe, in partnership with the leading Linux distributions and free software developers.
    www.hellotux.com
     

    Education
    Teaching digital competences for children between ages 9 and 14. The goal is not understanding ancient software but understanding the digital future.
    www.fenyvesirefi.hu
     

    Consulting
    IT consulting and services for government institutions. GAFAM-free and GDPR compliant local and EU-based systems on the base of open source.