From owner-freebsd-questions@FreeBSD.ORG Sun Aug 29 20:13:14 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64E0A16A4E0 for ; Sun, 29 Aug 2004 20:13:12 +0000 (GMT) Received: from sccimhc91.asp.att.net (sccimhc91.asp.att.net [63.240.76.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id B32D143D31 for ; Sun, 29 Aug 2004 20:13:11 +0000 (GMT) (envelope-from FreeBSD@insightbb.com) Received: from [192.168.1.239] (12-202-28-183.client.insightbb.com[12.202.28.183]) by sccimhc91.asp.att.net (sccimhc91) with ESMTP id <20040829201311i9100butkfe>; Sun, 29 Aug 2004 20:13:11 +0000 From: Steven Friedrich To: freebsd-questions@freebsd.org Date: Sun, 29 Aug 2004 16:13:10 -0400 User-Agent: KMail/1.6.2 References: <200408291538.06836.FreeBSD@InsightBB.com> <003c01c48e03$58827fd0$1200a8c0@gsicomp.on.ca> In-Reply-To: <003c01c48e03$58827fd0$1200a8c0@gsicomp.on.ca> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408291613.10585.FreeBSD@InsightBB.com> Subject: Re: finding the ip address X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2004 20:13:14 -0000 On Sunday 29 August 2004 04:04 pm, Matt Emmerton wrote: > > I'm messing with ubermon for superkaramba and I want to know how to get > > my hosts ip address from the command line (and only the ip address). > > > > I know I can grep and sed rc.conf or the output of ifconfig, but I'm > > hoping > > > there's a command like whoami for the ip address. > > There isn't anything that simple, but munging the output of ifconfig is > what you want. This assumes that your box only has one IP address (other > than localhost): > > # ifconfig -a | grep "inet " | grep -v 127.0.0.1 | awk ' { print $2 } ' > 192.168.0.4 > > -- > Matt Emmerton > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" Thanks for the info. I modifies your solution slightly, so I could use it for more interfaces easily. ifconfig dc0 | grep inet|awk '{print $2}'