The UNIX and Linux Forums  

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 02:57 AM
Mac address - what is line command to find and active new card wmetz IP Networking 1 03-19-2002 03:44 PM

Closed Thread
 
Submit Tools 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.
Sponsored Links
  #2 (permalink)  
Old 08-22-2002
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
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
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
Registered User
 

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

i was talking about LINUX only.
Google The UNIX and Linux Forums
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:




All times are GMT -4. The time now is 07:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66