|
|
Terminal command for finding you IP address?
|
|
|
|
Mac Elite
Join Date: Feb 2002
Status:
Offline
|
|
I'm looking for a way to find the local IP address of the computer from the command line... anybody know how?
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Dec 2002
Location: Newport Beach, CA
Status:
Offline
|
|
ifconfig en0 | awk '/inet /{print $2}'
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2002
Status:
Offline
|
|
Originally posted by EnVoy:
ifconfig en0 | awk '/inet /{print $2}'
Thanks!
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status:
Offline
|
|
Or you could just type ifconfig and look for the address. It would probably be more useful to be aware of the ifconfig command, vs. just getting your ip address on the built in ethernet.
|
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
Originally posted by EnVoy:
ifconfig en0 | awk '/inet /{print $2}'
You can avoid the pipe:
ipconfig getifaddr en0
To get an external WAN-side address:
curl -s http://www.showmyip.com/simple/ | awk '{print $1}'
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Jan 2002
Location: NYC
Status:
Offline
|
|
OR:
Code:
nslookup `hostname`
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2002
Status:
Offline
|
|
Thanks everybody... the new system preferences panel I no like...
You have to dig for an IP address, and even in some configurations it has proved not to even show one. Time to remember my UNIX!
That and the new way to get to the CPU meter. I can't find the expanded window... so I just copied over the old cpu meter app from a backup of one of my systems before panther. What a bummer dudes.
Other than that... things are pretty good besides having to update all my apps with the newest versions.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Jan 2002
Location: NYC
Status:
Offline
|
|
Originally posted by Tyler McAdams:
Thanks everybody... the new system preferences panel I no like...
You have to dig for an IP address, and even in some configurations it has proved not to even show one. Time to remember my UNIX!
That and the new way to get to the CPU meter. I can't find the expanded window... so I just copied over the old cpu meter app from a backup of one of my systems before panther. What a bummer dudes.
Other than that... things are pretty good besides having to update all my apps with the newest versions.
Umm... the new Network preferences Pane is much easier to find what your looking for in. by default it goes to the status screen that tells you link activity, configuration and ip address all in one little blurb.
As for the CPU monitor, it is part of activity monitor where it belongs. Just open that and in the menus it has opetions to show the activity monitor as a graph in a window, personally I keep mine a s a graph in my dock, but to each his own.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2001
Location: The Sar Chasm
Status:
Offline
|
|
Here's a slight twist on the same questin-- How to find the ip addresses of other computers on my LAN in terminal? I'm running a DHCP server to my kid's computer, with a range of 20 ip addresses, so I'm always having to guess when ssh'ing in to her machine. How can I discover the ip so I don't have to flail around from .1.100 to .1.120?
CV
|
When a true genius appears in the world you may know him by this sign, that the dunces are all in confederacy against him. -- Jonathan Swift.
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jul 2001
Location: NC
Status:
Offline
|
|
Originally posted by K++:
As for the CPU monitor, it is part of activity monitor where it belongs.
I might agree that it belonged there if using only that "feature" put no more drain on the system than CPU Monitor. However, it uses almost 10% of my CPU in any configuration. Thus, when all I want is a CPU Monitor, I think I'll stick with the old one.
|
Gary
A computer scientist is someone who, when told to "Go to Hell", sees the
"go to", rather than the destination, as harmful.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Status:
Offline
|
|
Originally posted by chris v:
Here's a slight twist on the same questin-- How to find the ip addresses of other computers on my LAN in terminal? I'm running a DHCP server to my kid's computer, with a range of 20 ip addresses, so I'm always having to guess when ssh'ing in to her machine. How can I discover the ip so I don't have to flail around from .1.100 to .1.120?
CV
You could configure the addresses manually
-
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Status:
Offline
|
|
Originally posted by Tyler McAdams:
That and the new way to get to the CPU meter. I can't find the expanded window... so I just copied over the old cpu meter app from a backup of one of my systems before panther. What a bummer dudes.
If you're talking about Apples little CPU-Monitor it's pretty the same. You won't get the expanded window though if you have the expanded view in the dock already.
-
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 2003
Status:
Offline
|
|
Originally posted by chris v:
Here's a slight twist on the same questin-- How to find the ip addresses of other computers on my LAN in terminal? I'm running a DHCP server to my kid's computer, with a range of 20 ip addresses, so I'm always having to guess when ssh'ing in to her machine. How can I discover the ip so I don't have to flail around from .1.100 to .1.120?
CV
Use the Rendezvous name? That's what it's there for...
e.g. ssh [email protected]
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2001
Location: CA, USA & Bangkok, Thailand
Status:
Offline
|
|
Originally posted by chaldean oracle:
Use the Rendezvous name? That's what it's there for...
e.g. ssh [email protected]l
that's a good solution.
|
^_^
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2001
Location: The Sar Chasm
Status:
Offline
|
|
Originally posted by chaldean oracle:
Use the Rendezvous name? That's what it's there for...
e.g. ssh [email protected]l
Hadn't thought of that. (obviously) thanks!
Still curious if there's a way to discover the actual ip adresses of other machines on the LAN, just because I'd likke to know if there's a simple command to do that.
CV
|
When a true genius appears in the world you may know him by this sign, that the dunces are all in confederacy against him. -- Jonathan Swift.
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 2003
Status:
Offline
|
|
Originally posted by chris v:
Hadn't thought of that. (obviously) thanks!
Still curious if there's a way to discover the actual ip adresses of other machines on the LAN, just because I'd likke to know if there's a simple command to do that.
CV
glad to help, cheers.
As for discovering other machines:
It's not foolproof, but you can do a broadcast ping:
ping 255.255.255.255
which will often get you replies from any other machines in your LAN.
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Aug 2001
Location: Atlanta, Georgia, USA
Status:
Offline
|
|
255.255.255.255 will not work, nor should it.
The poster is correct in saying that a broadcast ping is the most effective way to search other hosts on the LAN. Depending on the IP stack of the other machine, you should get a response. Most types of stacks will, indeed, respond.
My LAN at home is 172.16.12.0/24, so I:
ping 172.16.12.255
then -
arp -a
This will show you the information you're looking for.
If you are in doubt about the broadcast address of your LAN, you can find that information in the "ifconfig -a" command discussed above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|