Top Ten Mac OS X Tips for Unix Geeks
Lisa writes "There are big differences between Mac OS X and
Unix machines. In this MacDevCenter article, Brian Jepson has assembled ten
tips to help achieve a smooth transition from Unix to OS X."
← Back to Stories (view on slashdot.org)
had a brief segment last night showing the top 10 Mac OS X killer tips.. the link is here with some nifty tricks for your Mac..
If you're looking here for something insightful or thought provoking, you're probably looking in the wrong place.
Actually its Option - Apple - Esc. That gets you to 'force quit'.
I think you'll find that the variations aren't so much variations from Unix, but from Linux. Many of the differences the article outlines are simply "hiding" the Unix from newbies (i.e. dangerous directories) and can easily be over ridden.
The article's comments about NetInfo are a little off as well. OSX has been moving to using NetInfo less and less. 10.2 tends to utilize many more traditional ways of doing things.
I should add that most of those elements are hold overs from NeXT and the Darwin team appears to be making it more like a traditional BSD.
BTW - if you want a good Finder replacement with more Unix tools try Path Finder. It has lots of nice things such as creating SymLinks rather than Aliases etc. (Although Aliases are more powerful, but most Unix tools don't recognize them)
http://www.versiontracker.com/moreinfo.fcgi?id=149 96&db=mac
http://www.cocoaserver.com/virtualdesktops.html
:)
try this one
open source too if'n you're paranoid
You've got an easy breezy wind at your back...most of the time.
There's an editting error on the 2nd and 3rd lines of the table of directories in the article.
.trash - This directory contains files that have been dragged to the Trash.
./vol - This directory maps HFS+ file IDs to files.
AFAIK, it should read:
Isn't it suposed to be ~/.trash - in your user directory?
I don't own a Mac but I see 'em on the Sreen Savers.
Ever dream you could fly? Get up from the Flight Sim. I Fly
I just plunked down a whopping $20 for Codetek's Virtual Desktop (www.codetek.com).
Its a damn fine piece of software and was the final addon that made Aqua perfect for me.
"That naive cube! How long must I suffer this!" --Sheldon J. Plankton
Another "feature", at least in 10.1 is the 255 char line limit the Terminal has. This pops up in shell scripts at the worst times without warning.
Shareware ($20.00), but you can use it with two windows as nagware.
Space.app, which is free as in beer, in one such solution that provides multiple virtual desktops on Mac OS X. VersionTracker is to Mac OS X what Freshmeat is to Linux.
--- Fox
Warning: Virtual Desktops.app is not yet compatible with 10.2.
Is it a big change? yes. Is the whole world upside down? ummm.... no. You still have a shell, all the standard unix utilities and most everything is done the Unix way, even when it's done through the GUI. Personal Web Sharing is Apache. Windows File Sharing is Samba. Printer Sharing is cups. The firewall is a default deny ipfw setup.
Sounds like Unix to me. Though admittedly I'm biased, since I really like the fact that I'm posting this message from a unix box (OS X 10.2.1) that's currently running Illustrator, Photoshop and Quicken, while charging up my iPod.
Friend, FreeBSD isn't UNIX. UNIX is a trademark, and FreeBSD can't be called UNIX.
Besides Mac OS X contains a complete FreeBSD 4.4 distribution-- it is, in fact, a superset of FreeBSD-- so OS X is just as much a UNIX operating system as FreeBSD is.
I write in my journal
it uses NetInfo instead of /etc/hosts, /etc/group and /etc/passwd.
/etc/hosts first by default. So unless you're using 10.0 or 10.1, /etc/hosts will work just the way you think it should.
I do feel compelled to point out that OS X actually uses lookupd for host name resolution, and lookupd can be configured to use any number of sources for name-to-address mappings. Under 10.2 and later, lookupd is configured to look in
More info can be found in the lookupd man page.
I write in my journal
Are you positive about that? When I bought my last machine, it came with 10.2 installed, but the developer tools hadn't been installed at the factory. It had /usr/bin/bash on it.
I write in my journal
* Forget sudo and enable root access (I forget how, I don't have an OS X box in front of me), then use su.
Uhhh... why? If your suggestion resulted in some kind of improvement I might be convinced to go along, but why mess with things that don't need to be messed with? There's no reason at all to enable the root account on your OS X machine. If you absolutely, positively have to have a root shell, you can always use this little trick:
% sudo su -
Password:
#
I write in my journal
The problem is that some shutdown scripts aren't run at shutdown problem. Expect this to be fixed in 10.2.2. I believe that if you shutdown from the terminal that the problem doesn't happen. (I may be wrong on that, so don't quote me on it) If you Google a bit you can find lots of tips on getting your custom shutdown scripts to work right.
I hate to get into a price war, BUT:
My put-together PC:
-2.2GHz AMD Athlon XP w/133+MHz FSB & 533MHz motherboard bus (benchmarked to be equivalent to a 2.8GHz Pentium 4)
-1GB PC2100 DDR SDRAM
-3x60GB ATA-133 Drives & motherboard supports ATA RAID 0, 1, & 0+1
-DVD-ROM Drive
-48x/24x/48x TDK CD-RW Drive
-NVidia GeForce4 dual-display w/128MB DDR (No bundled displays) & motherboard supports AGP 8x
-Cool Blue/Silver Aluminum display case with 6 fans
-6 USB, 2 FireWire, 6 channel digital/optical audio, 1 CF/SM card reader
Price: $1,555.00
A roughly equivalent Mac that isn't too overpriced from store.apple.com on 10/25/02:
-Dual 867MHz PowerPC G4 w/133MHz system bus
-1GB PC2100 DDR SDRAM
-2x120GB ATA-100 Drives (this was the closest they had to my 60gb boot drive and 120GB RAID data drive)
-2X DVD-ROM + 16x/10x/32x CD-RW Drives (again, the closest I could get)
-NVidia GeForce4 dual-display w/128MB DDR (no bundled displays)
-I assume at least 2 USB and 2 FireWire, but their site doesn't say; I also assume no 6 channel digital/optical sound or a compact flash/smart media reader
Price: $3,249.00 (sorry, subtract the special $110.00 "Promotion Savings" from that price)
A roughly equivalent Dell system:
-2.8GHz Pentium 4 w/533MHz system bus
-1GB PC2100 DDR SDRAM
-1x120GB ATA-100 Drive (closest I could get)
-DVD-ROM Drive
-48x/24x/48x CD-RW Drive
-ATI Radeon 9700 Pro dual-display w/128MB DDR (no bundled displays)
-I assume at least 2 USB and added a 3 port firewire card; Turtle Beach Santa Cruz sound; no CF/SM reader
Price: $2,182.00 (subtract a $100 rebate from that price)
Now what were you saying about "where's the overpriced hardware"??? I think the answer to that question is obvious.
Of course, there are a few things people could take issue with, like:
-- Oh, but a PowerPC is so much faster than a Pentium 4! Especially 2 of 'em!
Answer: Yeah, right -- prove it.
-- Oh, but you can't run Mac OS X on a PC! And, Apple has better tech support!
Answer: I don't want/need OS X because I can pick from a half-dozen other arguably better OS's; and Apple's "support" is rated time-and-again as being far below Dell's support level.
I just can't see how a rational human being can state that Macs have closed the price gap. If anything, they've widened it! And I owned only Macs for 9 years!!!
"it uses NetInfo instead of /etc/hosts, /etc/group and /etc/passwd"
/etc/passwd) is consulted before NIAgent (which looks up info in NetInfo).
Kind of. The big change in 10.2 was that now the FFAgent (for using traditional flat files like
This is actually really convenient. It gives people the choice of either method as well as allowing you to use flat files to override settings in NIAgent and DNSAgent (which yeah, looks up DNS...) you can check the LookupOrder by running lookupd in debug mode.
lookupd -d
and then typing "configuration" at the lookupd prompt.
This article at macdevcenter was lame. A much more useful link for people coming from another unix to OSX is The Rosetta Stone for UNIX.
Or just browse MacOSXHints for an hour...
i don't read slashdot anymore.
Macs are definitely more expensive, but it's not quite as bad as your numbers indicate. You ordered extra RAM and hard drives from Apple; *never* do that, their markups are insane. A stock dual 867 with a GeForce 4Ti is $2050. From third parties, get 1 GB of ram for $250, 2 80 GB drives for $250, a Firewire CD-RW for $150, and you're at $2700 with a better system than you got from the Apple store. Still more than the Dell, but the difference is reduced by half.
How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
There's nothing magical going on here, it's just the difference between escapes that are processed by the shell before the program ever sees them and correct parameter syntax.
-Kevin
Why waste the keystrokes? just use sudo -s:
% sudo -sPassword:
#
Can I Play With Madness?
This program has exactly the same limitation of Space.app: Windows from one program can only be displayed in one workspace. So, for instance, you can't have Terminal windows open in more than one workspace.
It works by hiding the applications on a desktop, when you move from desktop to desktop.
If this is acceptable to you, Space.app does it for free. But it's a poor solution for those of us used to real virtual window managers.
lookup does not run in single user mode, but runs in multi-user mode (the normal mode of operation).
The files are actually kind of wrong as of 10.2, as the flat files do get consulted in multi user mode, and do so before the NetInfo database does.
ie,
See how 'FF' gets consulted before 'NI' ? This means that the flat file does get looked at. 'DNS' is self explanatory, and 'DS' stands for Directory Services like LDAP...
i don't read slashdot anymore.
Obviously the dollar-sign is a parser character right? Watch this:
Right? Okay...
Hmmm, obviously the - is not a character that the shell thinks is special, it just passed it straight through to echo
Ah, there's your reason, putting a backslash in front of a character that isn't otherwise parsed by the shell, just passes that char on through to the program.
If you pass a -- (two-dashes) to a GNU-ish (getopt and friends) program it'll stop parsing commandline options, and accept things like -p as an argument, and not a commandline option.
HTH!
When this story was posted over at MacSlash, somebody replied with a tip of their own, which I've found to be quite nifty.
What it involves is logging out, then logging back in as user ">console", with no password. You might have to select "Other User" or whatever that option is called, on the login screen. That'll allow you to skip Aqua, and just have a nice full-screen terminal to work with, instead.
Seems to vary greatly depending on which distro you use. Some bare a large similarity to the System V (/home/username) strain of *nix (red hat) whereas others lean more towards the BSD-like (/usr/username) distros of commericial *nix. Of course, OS X Jaguar leans towards BSD (/users/username is pretty close to /usr/username).
of course for the sake of keeping up, here's my top ten:
However for many other features Apple has been making things more standard.
Having said that I didn't say that NetInfo wasn't used. It is. I think it is used more for OSX system applications. (i.e. at the GUI level) So, for instance, most "hacks" for OSX dealing with UI elements involve NetInfo or related applications. However for the type of customizations that typical Unix people do, Apple has been moving to making their traditional hacks work. This, to me, is the best of both worlds. For one it means that many "how to" articles on the Internet for traditional Unix apps work. But you still have the elegance of NetInfo for features that are only available on OSX.
In other words if it is a function that is available on other Unixes, Apple will try and do it the traditional way. If it is a mainly Apple-only feature they'll do it the elegant way.
There are exceptions, such as users. But those are places where the flavors of Unix differ so much that it is difficult to say that the Linux way is the right way. (And frequently there are optional add-ons in these areas even for Linux)
to be Unix(tm), you have to have the Open Group certify you as being Unix (tm), which involves forking over cash. Apple is a member of the Open Group, and OS X is certified Unix (tm). (Free|Open|Net)BSD, however, are not Unix (tm).
BTW - GNU's Not Unix either.
I used to think what you say above, until I bought a Mac.
Have you ever owned a Mac or had a close look at one, inside and out? It's beautifully engineered. Every surface finished nicely, lots of thought given to things like cable management and noise reduction, easy access to parts that are meant to be user-accessible (not much on an iMac, just about everything in a G4 tower).
I once had a Compaq Presario that required me to _remove_the_motherboard_from_the_case_ to add memory! (Yes, that's what their tech support said to do.) Unbelievable.
Homebrew machines tend to be more accessible, but watch out for the sharp edges on that metal case! and have plenty of twist-ties handy for the cables on any Intel-type box.
I feel that OS X is the best desktop Unix around now (I used to say that about Linux), and it runs only on Mac hardware. My Mac is worth every penny of its price to me.
In other words, Apple is taking a big step here and embracing open-source about as much as you can expect a big corporation to do. Sure they don't give away the whole farm, but they are promoting an environment which is at least friendly to open-source even if it isn't 100% open.
Sapere aude!
Good reasons to switch to 10.2 from Linux/PPC or NetBSD or WHATEVER...
1. Better power management (crucial for me, with a TiG4 DVI).
2. Quake 3 !
3. EXCELLENT 1392 support. Linux is still flaky at times with many devices.
4. Cocoa API. This is a *REAL* serious reason.
5. First-rate font and color support.
6. Nice anti-aliasing isn't just eye-candy, it's great for extended-duration viewing, imho.
So this isn't a problem anymore and hasn't been for quite some time.
...but from a design point of view, OSX is an anathema. This article just makes it clearer: OSX is, not a port of MacOS or an enhancement of Unix, but a bloody (and fatal?) collision between the two, where both lost what clarity and integrity they had by attrition to the other.
What? Have you actually *used* it? How about this explanation instead: they've managed to create one unified operating system that keeps some very diverse users happy. If you're an end-user technophobe, what you see is a very nice, clean, end-user system, far nicer than Windows, and without the 10 years of cruft that OS9 had accumulated. On the other hand, if you understand computing, you have a complete Unix-ish system, again, without a lot of the cruft that other Unix systems have accumulated. The Apple engineers deserve major kudos for keeping the "collision" under control as well as they did... they of course have backward compatibility to deal with, too.
Yes, the file copy stuff is a little ridiculous, but geez, the complaints on that level are pretty few, considering how much elegant functionality there is in there otherwise.
Aliases are sort of a hybrid between a symlink and a hard link. They keep track of the HFS file id of the target file.
Prior to 10.2 the default behavior was to first check the file id, and if that file isn't there any more then check the file location. In 10.2 this behavior changed to be more like a symlink. First it checks the file location, then it checks for a file of the given file id.
To sum up: aliases are more powerful than symlinks because they do everything that a symlink does (when accessed through the mac file apis, not the BSD ones), but can also still find the target file if it's been moved to a different directory.
"It is our blasphemy which has made us great, and will sustain us, and which the gods secretly admire in us." - Zelazny
It probably depends on what kind of development your developer is trying to do, but...
It sounds like he either tried to do all this with a pretty early version of OS X (before most major tools were ported), or he just didn't know where to look.
If I didn't have it all installed already, in just a few hours I could have Apache, PHP, Perl, MySQL CVS, CVSWeb, and a number of other tools installed and ready to go. Install the dev tools and you'll likely have most of this stuff installed to begin with.
Again, it depends on what he does. But for my own needs (admittedly relatively light), it was a piece of cake.
- Jeff
Did you introduce him to fink? By default, the Mac comes with the entire GNU toolchain, plus perl, python, and a ton of other utilities. If he needed newer versions of perl or python, or if he something else (Ruby, MySQL, PostreSQL, X window, Ant, OCaml, LaTeX, even KDevelop and KDE for Pete's sake!) he just types in
fink install python
for example, and, after five to twenty minutes (depending on the package), he's got whatever he needed. It's as easy as apt-get and it's fully OS X native. Check out the link; there are 1600 packages so far and going up literally daily. So my question is, how experienced was your developer?
Go to VersionTracker and do a search for MouseZoom. It'll speed up both mice and trackpads far beyond the Apple defaults.
As far as cp goes, most files will copy fine, but if you work with files that have resource forks (fewer and fewer as time goes by) then install the Dev Tools and use CpMac and MvMac, which handle resource forks properly. Or use 'ditto -rsrc' which handles forks as well.
As far as the alias thing goes, 1) it is not too hard to avoid aliases and 2) they are designed to be convenient to your average user. By default there are not many in the system, so provided you make symlinks rather than aliases all is well. Having used OS X since Public Beta, I have yet to have had a real problem with the alias/symlink thing. *NIX tools do not like aliases, so I always use symlinks instead, no big deal.
Aliases point to a file in an intuitive way to a non-technical person - if you move or rename the file it keeps pointing to the file - if you replace it, then it points to the replacement, simple for grandma to get.
As for breaking aliases, you are in error saying that renaming your HD will do this. When I managed Mac labs, users used to rename various HDs in labs fairly often, which I would name back. There were no ill effects on any aliases. I have done full and partial restores from backups using Retrospect with no unexpected effects on aliases, sounds like you were using a crappy backup tool.
Hyperbole is the worst thing ever.
Bash shell is included in 10.2
[Computer:~] acomjean% bash
bash-2.05a$ yes
y
y
y
y
y
[bast:~] lemke% ls /bin/*sh
/bin/bash /bin/csh /bin/sh /bin/tcsh /bin/zsh
That is from this machine running 10.2.1.
Not entirely true.
bash is the default "sh" shell (for scripts).
However, the default "user" shell is tcsh.
My experience porting my application to various unices is that porting from Linux to Mac OS X is a no-briner; the toolchain to build programs on the both unices is the GNU toolchain, and is almost identical.
The only Unix I have had a hard time porting to is Solaris; then again, I have not tried porting my application to other prorpietary unices like HPUX, Ultrix/OSF-1/whatever they call it these days, AIX, etc.
- Sam
The secret to enjoying Slashdot is to realize that it should not be taken too seriously.