no "ifconfig", how do I find out what IP address I was assigned?
Sorry, a bit of a stupid question, but since "ifconfig" seems to not be present, how do I find out what IP address the DHCP server assigned me?
I tried going into hat|system settings|network, but it doesn't actually say what my IP is (least, not anywhere I could find it!).. kinda seems like it would be a good place to put it, no? oh well.. thanks for any help. |
Did you try netstat -n, you might want to set up an outside connection first (web, ftp, whatever).
Might give you a starting point to search the files (/etc ??) it could be stored in. |
Actually ifconfig is installed on Fedora Core 2.
You have to do a"su -" to login is as superuser. Just doing a "su" without the "-" will not give you access to it. Do a "su -" and enter the root password when prompted. Then type "if" and hit the tab key to display all executable files that start with "if" I hope this helps! |
You don't need to su! This is another Linux path gotcha! The full command is
/sbin/ifconfig. /sbin/ is not in the default search path for users, but only for root. THAT's why su'ing works. You can run this without su'ing if include the /sbin. |
Quote:
I would still contend that the "Network" section of "System Settings" would be a convenient place in the gui maze (using gnome) to put the current IP address. Thanks for the help! Off to learn what "su -" is... edit: spelling and "su -" just seems to be -, -l, --login make the shell a login shell which doesn't make too much sense to me... I wonder what the distinction of being a "login shell" is-- running .profile and .bash type stuff? If so, I wonder if other distributions have "su" aliased to "su -" since just doing "su" in the past was enough to get ifconfig to work. hmmm... thanks again.. |
great question and answers - always wondered myself!
Just wondering - why is there a difference between su & su -? |
when using su, the - following the command just inherits the environment of the subsitute user. without it, su root just gets your root but keeps your old enviroment settings
|
UPDATE for new Linux Distros, i.e. RHEL7
I found tis thread looking for the same info, and after a little investigating found that net-tools have been deprecated in the newer Linux's. Passing this along in case others have the same question.
The ifconfig cmd has been replaced with ip. To list an grep the ip for an interface use this now, for example - ip address | grep eth0 | awk '{ print $2 }' Use ip --help or man ip for more info on the ip cmd. |
The best way (and the single one) that works for me was :
Code:
ip addr show |
All times are GMT -5. The time now is 03:05 PM. |