From owner-freebsd-questions@FreeBSD.ORG Sun Aug 29 20:07:00 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 837BE16A4CE for ; Sun, 29 Aug 2004 20:07:00 +0000 (GMT) Received: from skippyii.compar.com (compar.com [216.208.38.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFC7643D46 for ; Sun, 29 Aug 2004 20:06:59 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from hermes (CPE00062566c7bb-CM000039c69a66.cpe.net.cable.rogers.com [69.193.82.185])i7TKBuJD097948; Sun, 29 Aug 2004 16:12:01 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <003c01c48e03$58827fd0$1200a8c0@gsicomp.on.ca> From: "Matt Emmerton" To: "Steven Friedrich" , "FreeBSD-Questions" References: <200408291538.06836.FreeBSD@InsightBB.com> Date: Sun, 29 Aug 2004 16:04:03 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 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:07:00 -0000 > 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