Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rating: Thread Rating: 18 votes, 5.00 average. Display Modes
Old 01-30-2006, 07:37 PM   #1
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
I have noticed that even the syntax of "ping" is slightly different using the Terminal in Mac OS X 10 (my version 10.4.3). Can anyone help me with the Unix equivalent of these simple internet protocol configuration commands? (I cannot even find this in the O'Reilly book Learning Unix for Mac OS X 2nd Edition, copyright 2003) Thanks in advance.

Example 1
{Dos} C:\ping google.com -t
{Unix Equivalent} user$ ping google.com

Question 1)
{Dos} C:\ipconfig
{Unix Equivalent} user$ ????????

Question 2)
{Dos} C:\ipconfig /release
{Unix Equivalent} user$ ????????

Question 3)
{Dos} C:\ipconfig /renew
{Unix Equivalent} user$ ????????
bloozman is offline   Reply With Quote
Old 01-30-2006, 08:36 PM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,463
I think you want to look at the 'ifconfig' command (/sbin/ifconfig) - read 'man ifconfig' for details.
__________________
hayne.net/macosx.html
hayne is online now   Reply With Quote
Old 01-31-2006, 12:56 PM   #3
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Thank you Hayne of Tintagel. You seem a true knight in this modern world, and a technology wizard to boot. Both Arthur and Merlin would be proud. Over 13,000 posts of helpful advice! Not even the knights of the roundtable were that helpful to people in distress. Apple should be paying you for sure.

I have taken a look through both 'man ipconfig' and 'man ifconfig' and I have yet to discern a set of commands that release and renew the ip configuration, the way I could utilize the commands in my original question in the Windows/DOS environment. Some sound like they may be close, but none have worked thus far.

I am also amazed that these very common commands in DOS are not widely known and used by Unix Terminal users.

No one out there actually knows for certain what the specific comparable commands are to the ones I asked????

Come on Mac Users. I thought you guys were the elite of technology

Last edited by bloozman; 01-31-2006 at 04:36 PM.
bloozman is offline   Reply With Quote
Old 01-31-2006, 01:12 PM   #4
Raven
Hall of Famer
 
Join Date: Jul 2003
Location: Montreal
Posts: 4,782
Yes we are (lol) but with the Macs we married
Seriously though. Apple did impliment quite a few changes with their UNIX compared to standard distros to try and make things simpler if not more complete. Also they had to add to it for the GUI programs and interface. Would be nice if you could cross-impliment those "extra" functions.
By doing a search for the floowing terms on Google (UNIX release renew ip configuration), I came up with this nice link for you:
http://www.windowsitlibrary.com/Content/155/13/2.html
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
Raven is offline   Reply With Quote
Old 01-31-2006, 01:13 PM   #5
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,463
Quote:
Originally Posted by bloozman
I thought you guys were the elite of technology

We are. That's why we use the very nice GUI's that Apple provides for doing things like renewing the DHCP lease - see screenshot below.
An alternative would be to switch to a different "location" and back again using the item in the Apple menu.

Using 'ifconfig en0 down' and 'ifconfig en0 up' will force a DHCP renewal. But I would be careful in using these in case the higher-level (GUI) software gets confused.
Attached Thumbnails
Click image for larger version

Name:	Picture 1.png
Views:	1555
Size:	33.4 KB
ID:	1092  
__________________
hayne.net/macosx.html
hayne is online now   Reply With Quote
Old 01-31-2006, 02:26 PM   #6
giskard22
Moderator
 
Join Date: May 2003
Posts: 4,272
There's also the networksetup command. If you tell it turn off IPv4 on an interface, then turn it back on, that should cause a DHCP renewal.

The annoying thing about networksetup is you can't just use typical UNIX-style references to network interfaces (en0, etc). Instead, it uses the names that you see in the status section of the Network preference pane, a la "Built-in Ethernet". Otherwise it basically provides a direct interface to everything that Network does.
giskard22 is offline   Reply With Quote
Old 01-31-2006, 03:14 PM   #7
cwtnospam
League Commissioner
 
Join Date: Jan 2005
Posts: 8,475
I find this useful when I don't know what command I want, but know what I want to do:
http://www.ss64.com/osx/
cwtnospam is offline   Reply With Quote
Old 01-31-2006, 03:28 PM   #8
Raven
Hall of Famer
 
Join Date: Jul 2003
Location: Montreal
Posts: 4,782
What I do with commands I either frequently use or those I know I always have to refer to the man page for... I created a series of folders for different types of commands, such a system comands, file commands, networking commands, etc... And the first time I use the command I run this:

man awk | col -b > ~/Path/to/The/Proper/Folder/awk.txt

So I have all those man pages as txt files as ref and I can search by category afterwards.
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
Raven is offline   Reply With Quote
Old 01-31-2006, 05:18 PM   #9
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,845
Quote:
Originally Posted by bloozman
I am also amazed that these very common commands in DOS are not widely known and used by Unix Terminal users.

Quote:
Originally Posted by Raven
Apple did impliment quite a few changes with their UNIX compared to standard distros to try and make things simpler if not more complete.

There might be a misunderstanding here that DOS is the original OS and Unix is a newcomer.

The truth is that DOS is a copy of Unix (and also even more closely a copy of yet another operating system--CP/M), changing just enough from it's two projenitors so that it's original author, Tim Paterson, would not get sued. DOS was originally QDOS: Quick and Dirty Operating System, and it's original version was hacked together in 6 weeks.

Quote:
I have noticed that even the syntax of "ping" is slightly different using the Terminal in Mac OS X 10 (my version 10.4.3). Can anyone help me with the Unix equivalent of these simple internet protocol configuration commands? (I cannot even find this in the O'Reilly book Learning Unix for Mac OS X 2nd Edition, copyright 2003) Thanks in advance.

Example 1
{Dos} C:\ping google.com -t
{Unix Equivalent} user$ ping google.com

Question 1)
{Dos} C:\ipconfig
{Unix Equivalent} user$ ????????

Question 2)
{Dos} C:\ipconfig /release
{Unix Equivalent} user$ ????????

Question 3)
{Dos} C:\ipconfig /renew
{Unix Equivalent} user$ ????????

1)
ping -c 3 google.com

2)
ifconfig
In OS X 10.0.x and 10.1.x, you would need to use ifconfig -a

3)
sudo ifconfig en0 down

4)
sudo ifconfig en0 down;sudo ifconfig en0 up

Trevor
trevor is offline   Reply With Quote
Old 02-01-2006, 11:12 AM   #10
Raven
Hall of Famer
 
Join Date: Jul 2003
Location: Montreal
Posts: 4,782
Sorry if I was not clear. I did not mean that DOS was older .... loll Thats would be a very ridiculous thing... and I'm sure the computer world as we know it wouldn't be as "nice" if the origins were not UNIX but DOS...
__________________
Waffled foreheads are a symptom of broken keyboards and inexperienced users
Raven is offline   Reply With Quote
Old 02-02-2006, 04:23 PM   #11
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Ah, Hayne of Tintagel and Montreal has solved another one. One might even give him the status of Goodly Knight with the capital "G", like invincible sir Galahad, himself. (Alas, it seems perhaps I know more of Chretien's Arthurian Romance tales than I do the Mac interface at this point).

That's right Professor Hayne. That's one of the reasons I bought a mac, so I would, hopefully, have to do less of that system command stuff, and use a GUI whenever possible to help me out. Why not? Of course, I did not know it existed. The DHCP renewal GUI from Hayne's attached thumbnail worked beautifully, once I found it and it took only seconds to find. Thank you.

I very much appreciate all of the comments and I will follow all of these links provided and read the information. I think you all showed me probably more than one approach that will work. It appears that Trevor may have provided me with the equivalent commands from the Terminal, which should come in handy someday, as well.

Hopefully, I can be useful in this forum someday -- if not already by asking the questions -- since I can do a fair amount in a windows environment and I trust I will be able to do a lot of the same and more in Macintosh, too. I will likely ask the same questions that hopefully millions of other former Windows users will want to know.

Thank you all, again. I very much appreciate the assistance.

Last edited by bloozman; 02-03-2006 at 10:55 AM.
bloozman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump



All times are GMT -5. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.