LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-20-2007, 07:34 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
Question command to find ip address in a local network


hi
what is the command to find the ip address of my system .
 
Old 12-20-2007, 08:06 AM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 78
Code:
# ifconfig
Read man ifconfig for options.
 
Old 12-20-2007, 02:17 PM   #3
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 302
Blog Entries: 1

Rep: Reputation: 34
ifconfig -a
 
Old 12-20-2007, 02:45 PM   #4
bbfuller
Member
 
Registered: Dec 2007
Location: UK
Distribution: Fedora, CentOS, Sabayon
Posts: 209

Rep: Reputation: 35
I gather that the command ifconfig is now deprecated and in at least some distributions its replacement is installed as well.

The new command is ip followed by a switch.

Code:
ip addr
gives a similar output to ifconfig.

The other switches are available in:

Code:
man ip
Code:
ip neigh
is very useful to see what else is running on your network.

Last edited by bbfuller; 12-20-2007 at 02:46 PM.
 
Old 12-21-2007, 12:07 AM   #5
LinuxCrayon
Member
 
Registered: Nov 2007
Location: Georgia, USA
Distribution: FreeBSD
Posts: 274

Rep: Reputation: 30
Also, it should be noted that at least on Fedora, both of those reside in /sbin/, which is not part of a normal user's path (as it contains tools meant for root, or so that is my understanding) and so the user will need to add /sbin/ to their PATH or they will need to type

Code:
$ /sbin/ifconfig
or

Code:
$ /sbin/ip addr
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.
 
Old 12-21-2007, 07:35 AM   #6
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u linuxCrayon

u r right . typing with the path name(/sbin/) only worked .
 
Old 12-21-2007, 07:56 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,046
Blog Entries: 1

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Hi,

Quote:
Originally Posted by bbfuller View Post
I gather that the command ifconfig is now deprecated and in at least some distributions its replacement is installed as well.

The new command is ip followed by a switch.

Code:
ip addr
gives a similar output to ifconfig.

The other switches are available in:

Code:
man ip
Code:
ip neigh
is very useful to see what else is running on your network.
You should read the 'man' that you are referencing.

I would like to clarify the above;

Quote:
excerpt from 'man ifconfig'

IFCONFIG(8) Linux Programmer's Manual IFCONFIG(8)

NAME
ifconfig - configure a network interface

Quote:
excerpt from 'man ip'
IP(8) Linux IP(8)

NAME
ip - show / manipulate routing, devices, policy routing and tunnels
The two commands are used for different actions. No deprecation!
 
Old 12-21-2007, 08:11 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,046
Blog Entries: 1

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Hi,

Quote:
Originally Posted by LinuxCrayon View Post
Also, it should be noted that at least on Fedora, both of those reside in /sbin/, which is not part of a normal user's path (as it contains tools meant for root, or so that is my understanding) and so the user will need to add /sbin/ to their PATH or they will need to type

Code:
$ /sbin/ifconfig
or

Code:
$ /sbin/ip addr
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.
The '/sbin' is not included in the normal user path to prevent the average user from damaging the system. The root or superuser account should be treated with respect so as not to cause undo able damage. I agree that a user can use the absolute path to get to a command but that can also create the same.

Quote:
Originally Posted by LinuxCrayon View Post
In my situation, as a default new user, it is NOT necessary to be root to access these two particular commands.
You probably modified the user profile or path.
 
Old 12-21-2007, 02:07 PM   #9
LinuxCrayon
Member
 
Registered: Nov 2007
Location: Georgia, USA
Distribution: FreeBSD
Posts: 274

Rep: Reputation: 30
Hello again, Onebuck.

Nope. Haven't modified it at all. In fact, even without being root, I can shutdown the system...do all kinds of stuff that I probably should not be able to do. I've found this to be true of Fedora and OpenSUSE. Note that this is with the default new account set up during installation...and I haven't tested that with any newly created users. Apparently the OP found the same to be true.

As a side note, I should probably remove permission to /sbin...
 
Old 12-22-2007, 07:09 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,046
Blog Entries: 1

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Hi,

Quote:
Originally Posted by LinuxCrayon View Post
Hello again, Onebuck.

Nope. Haven't modified it at all. In fact, even without being root, I can shutdown the system...do all kinds of stuff that I probably should not be able to do. I've found this to be true of Fedora and OpenSUSE. Note that this is with the default new account set up during installation...and I haven't tested that with any newly created users. Apparently the OP found the same to be true.

As a side note, I should probably remove permission to /sbin...
I would most certainly do this for any system that will have multiple users on. Especially for any server you may want to setup.
 
  


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
static ip address on local network sloooow... richardg Linux - Networking 6 02-19-2007 12:45 AM
why does FTP server send local network address in passive mode? edesmarais Linux - Newbie 11 03-16-2005 12:33 AM
Command to find my IP address? mwheeler Linux - Networking 6 11-20-2004 05:26 AM
Command to find workstation IP address minno44 Linux - Newbie 2 10-08-2004 03:11 PM
Finding Local network IP address. zaphanol Linux - Networking 9 07-25-2003 11:41 AM


All times are GMT -5. The time now is 07:02 AM.

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