The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 08:12 PM
san lv showing old fs itik AIX 2 05-07-2008 07:50 AM
tar -xvf is showing error Renjesh SUN Solaris 10 04-17-2008 03:50 AM
command to know the IP address suri Shell Programming and Scripting 1 03-14-2007 03:57 AM
Mac address - what is line command to find and active new card wmetz IP Networking 1 03-19-2002 04:44 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-22-2002
danhodges99
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Question Command for showing IP Address

Hi everyone, nice forum!
I need to know if there's a command that will show the IP Address of the machine you are logged into. Eg when you type hostname it returns the name of the machine, I need one that returns the IP address only. Can anyone help or suggest commands that are almost what I want?
Thanks.
  #2 (permalink)  
Old 08-22-2002
halfling halfling is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 8
`ifconfig` will give you any details you want (`ifconfig -a`)... or you might be able to grab it from your /etc/hosts file...

grep `hostname` /etc/hosts |awk '{print $1}'
  #3 (permalink)  
Old 08-22-2002
asifraj's Avatar
asifraj asifraj is offline
Registered User
  
 

Join Date: Aug 2002
Location: India
Posts: 48
to run ifconfig, you need to be a superuser

if not, just say

hostname -i

thanks
asif
  #4 (permalink)  
Old 08-22-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
Quote:
Originally posted by asifraj
to run ifconfig, you need to be a superuser

if not, just say

hostname -i

thanks
asif
Not on all systems. I was just able to `ifconfig -a` on my FreeBSD system as a common user (not part of the wheel group).
  #5 (permalink)  
Old 08-22-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
Linux?? for ipconfig

I guess you guys are talking Linux because I can't find that command on my HPUX system.

My commands are:

netstat -rn # shows info from the routing table.
grep `hostname` /etc/hosts





  #6 (permalink)  
Old 08-22-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
ifconfig -a on Solaris would give you the following type of info - to get the same on HP-UX you would have to do ifconfig lan1 (or specific interface - gather that info from lanscan)

$ ifconfig -a
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 1
inet 10.14.6.6 netmask fffffc00 broadcast 10.14.6.255
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 2
inet 127.0.0.1 netmask ff000000

On HP-UX:
$ lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
8/4/2/0 0x0060B0F93BA9 1 UP lan1 snap1 1 ETHER Yes 119

$ ifconfig lan1
lan1: flags=843<UP,BROADCAST,RUNNING,MULTICAST>
inet 10.14.8.2 netmask fffffc00 broadcast 10.14.8.255
  #7 (permalink)  
Old 08-23-2002
asifraj's Avatar
asifraj asifraj is offline
Registered User
  
 

Join Date: Aug 2002
Location: India
Posts: 48
yes sir,

i was talking about LINUX only.
Sponsored Links
Closed Thread

Bookmarks

Tags
linux, linux commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0