Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

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, 02:05 PM   #2
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

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

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

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


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 04:41 AM
Post current IP address to .php PatheticalPanic Linux - Networking 3 06-27-2006 01:37 AM
Display current refresh rate (XFree) McCloud Debian 2 11-11-2004 06:34 AM
Display the current forum's questions in frame vharishankar LQ Suggestions & Feedback 6 09-10-2004 12:37 PM
How can I tell my current IP address? (DCHP assigned) deanbrown3d Linux - Newbie 3 08-17-2004 04:24 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:29 PM.

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