LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-24-2007, 08:10 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,129

Rep: Reputation: 30
Display current IP address


I would like to have a shell script that can display the user IP address , I think it is similiar to "who -m | awk -F: '{ print $6}'" , this script is used to display what IP is when the user run the program . thx in advance.
 
Old 07-25-2007, 01:05 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
How about this?
Code:
/sbin/ifconfig | grep "inet addr" | awk '{print $2}'

Last edited by stress_junkie; 07-25-2007 at 01:10 PM.
 
Old 07-25-2007, 01:08 PM   #3
GregLee
Member
 
Registered: Feb 2004
Location: Waimanalo, HI
Distribution: Slackware 10, Fedora 6
Posts: 308

Rep: Reputation: 30
Or "hostname -i".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display the current time at a different timezone stinkytofoo Linux - Software 3 07-18-2007 03:41 AM
Post current IP address to .php PatheticalPanic Linux - Networking 3 06-27-2006 12:37 AM
Display current refresh rate (XFree) McCloud Debian 2 11-11-2004 05:34 AM
Display the current forum's questions in frame vharishankar LQ Suggestions & Feedback 6 09-10-2004 11:37 AM
How can I tell my current IP address? (DCHP assigned) deanbrown3d Linux - Newbie 3 08-17-2004 03:24 PM


All times are GMT -5. The time now is 11:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration