Re: using grep to find IP address...

From: Greg Beeker (gbeeker_at_gmail.com)
Date: 05/31/05


Date: 31 May 2005 08:57:53 -0700


balgach@gmail.com wrote:
> Hello all, i am interested in the last 255 bits of the local machines
> ip address (aka the last number after the period) so far ive been
> using the command, i know all the ip address start with 192.168
>
> ifconfig | grep '192.168' | awk '{print $2}'
>
> which is returning:
>
> inet addr:192.168.0.20
>
>
> now how do i get it just to return the '20' ??
ifconfig | grep '192.168' | awk '{print $2}' | awk -F. '{print $4}'



Relevant Pages

  • Re: lightweight internet browser
    ... and insults anyone that doesn't use the command line in Linux as their ... ''Sidney'' aka ''Tom Newton'' aka ''Alan Connor'' aka a string of other ... Take, for example, his stance on the command line: ... he claims it to be his preferred environment, ...
    (comp.os.linux.misc)
  • Re: using grep to find IP address...
    ... > ip address (aka the last number after the period) so far ive been ... > using the command, i know all the ip address start with 192.168 ... Alternatively, specify either "." ... or a space char as the separator: ...
    (comp.unix.shell)
  • Re: rm -rf *.orig not working
    ... The rm command does not see the wildcard character, ... Jakub Fišer AKA mr@xxxxxxxxxxxx ... ICQ: I don't see kyou - http://icq.xmpp.cz/ ...
    (alt.os.linux)
  • Re: Downloading Headers
    ... That's the way the Headers button (aka Get Next... ... the Synchronize Newsgroup command with just Get messages marked ... Robert Aldwinckle ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • How to change the directory for a debug log file?
    ... I want to generate a log file for debugging output. ... I want it in my project's debug directory. ... I enter the following for Command Arguments: ... aka $. ...
    (microsoft.public.vc.language)