A 'Welcome kit' for new Mac UNIX users
Dec 30, '02 08:30:07AM
Contributed by: SOX
I have found myself introducing one UNIX user after another to Mac OS X. They all have these growing pain rants until I teach them how to get along in the Mac world. To this end I created a "welcome list" of things a UNIX user needs to do. It's not intended to be a wish list of every cool Mac trick -- that's what this site is for. But this is a minimal set of tips that will sooth most problems out of the box. I'll pass it along.
[Editor's note: The following is a great "getting started" kit for transitioning UNIX users. You may not necessarily agree with 100% of the following advice (I know I differ on some items), but overall, this is a good summary of some key differences to keep in mind as you start working with the Mac. If there are errors in URLs they're my fault as I converted them into true hyperlinks; hopefully I didn't mess any up in the process...]
Dear UNIX user, welcome to Mac. If you trust me you will just do all of the following without asking why, before you start whining about features you miss. The following is a no-fat-added list of essential customizations.
- The Mouse.
Go buy a three button USB mouse. Make sure you get an optical mouse with a wheel. Buy the most expensive one you can. Many hereditary Mac users prefer a one-button mouse, but you won't.
- The Terminal.
Open /Applications -> Utilities. Drag the terminal.app icon to the dock.
- File system journaling
Open the terminal.app and type sudo diskutil enableJournal /Users. Just do it. This is not undoable, and you can change how you want it later.
- The Compiler
Regardless of what compiler you prefer, you need the native compiler and libs. Goto Apple's Developer Site and register for free. Enter the site and select the Downloads option and then the OS X section. Scroll through the list until you find "Developer Tools," download and install it.
- Installing GNU ports part 1.
Goto SourceForge and find the latest stable release of "finkā? for Mac OS X. Download and install it. There will be some questions to answer, just choose the defaults except if offered, ask it to get updates from CVS.
- Install X-windows part 1
If you have five hours to kill, type in the Terminal fink install xfree86-rootless. This is preferred as it gets the latest release of a fast changing package. But if you are in a hurry you can install the binary. Type sudo dselect. Quick intro to dselect, after some preliminaries you are offered the chance to choose packages from a list. Use the downarrow key to move down and find xfree86-rootless. Press the "+" key to select it. You will be offered "conflict resolution." Accept the defaults by pressing return. Then return again to exit the selection. DO NOT GET GREEDY and select other packages yet.
- Installing X-windows part 2: the window manager
You may prefer Fwvm2 or some other window manager, but take my advice and try out OroborOSX first. OroborOSX does things the Mac way, and later you will be glad you did it, even if it's not familiar at first. OroborOSX deliberately eschews many optional features, letting the OS provide those services. For example, if you want virtual screens you DO NOT want them as part of the windows manager! You want them as part of Aqua so that they apply to both Aqua and to x-windows. Get the latest version from the OroborOSX site. Note that the 'oroborus' that comes with Fink/dselect is not the same thing.
- Installing GNU ports part 2.
Use dselect or fink to install a few packages. Fink has about 2000 packages available including your favorite parts of kde and gnome. To see what's avalaible type fink list | more. Just for practice try installing gv (ghost view) and xemacs. Remember, dselect will install binaries (fast), and fink will install source (slow), generally dselect is a good idea. Once a month type fink update-all to get package updates.
- Text editor
Goto BareBones and get a free copy of BBEdit Lite. I recommend buying the full version. Note that you can save files in unix, Mac, and PC formats which have different end of line characters. Despite the name, on a Mac you should use UNIX format. Mac mode is mainly for historic reasons but gums up UNIX commands. Even if this (amazingly) does not turn out to be your preferred editor, you should install it anyhow so that it is there for guests.
- Mounting network disks
You can mount NFS disks by creating a file that looks just like the usual /etc/fstab file. It does not matter where you put it since the Mac will ignore it. To mount the disks type sudo niload fstab followed by the file path name. However, don't do this right away until you have more experience. Instead do the following. In the finder window, select Go -> Servers. In the text field type nfs://some.ip.address/path, where 'some.ip.address' is the IP address or domain name of the host with the disk. The disk will be mounted in /Volumes and be "aliased" to the desktop. To mount Windows network disks, we use smb://some.ip.address/path. Be nice and unmount your disks (throw them in the trash) before disconnecting from the net
- Using X-Windows across the network.
All the usual stuff (like xhosts and DISPLAY) work as expected. However, you do need to activate oroborus (which will fire up X-Windows) since it's not on by default. However, before you do this let me suggest an alternative you may find better. Goto Apple's Network & Security OS X downloads page and download VNCdimension (or VNCthing) and install this application. On the X windows client, run vncserver. And on the Mac attatch to it using VNC dimension. On anything but the fastest network connection, you will find this smoother and faster than using X-Windows. Plus it's more secure and even runs through firewalls. At present, much of X-windows on the Mac is not graphically accelerated, but VNC Dimension, which runs in Aqua, is.
- Shortcuts worth knowing about
On your unix machine to run netscape you type /usr/bin/Netscape &. On a Mac, you type open /Applications/Netscape. To open the file browser at the current working directory type open . (note the period). To open a web page type open http://macosxhints.com.
- Pitfalls
There are few pitfalls in the file system you need to know about early on.
First be careful with cp, mv, rsync, and tar. For 99.9% of the time they work as expected. But a lot of Mac applications and Mac documents store info in something called the "resource fork" of a file. UNIX files only have a single data fork. Mac files have a data and a resource fork. The data fork is the same as what you would see on the UNIX system. The resource fork can contain almost anything, but usually contains unimportant meta-information about the file itself like what app created it, and so on. But sometimes it contains crucial information (e.g Quicken). When you do a UNIX cp or mv or tar, all you get are the data forks. The rule of thumb is this: if your file can be used by a UNIX program then don't worry about the resource fork. Most modern Mac apps do not use the resource fork but older ones do.
Second, Mac filenames are case-insensitive but case preserving. Thus ReadME and readme are the same file.
Third, unfortunately, for backwards compatibility there are two different kinds of soft links on a mac. One is the usual UNIX soft link and the other is the "alias" function of the OS. The OS is smart enough to recognize the UNIX links and treat them as file aliases in the GUI. But the reverse is not true. Generally you are better off using the UNIX soft links.
Fourth, Macs have three layers of file permissions where UNIX has one. Macs have the usual UNIX permissions. Plus there is an ability to lock a file against changes or deletion, and finally there is the ability to lock a file against modification even by root. Generally you won't ever need either of the latter two, but you may someday find a file you can't seem to delete! Just in case, the normal file lock is accessed via "Get Info" in the Finder.
Fifth, fstab, exports, shadowpassword, passwd, and most UNIX configs don't work the way you expect. Use the admin tools to alter NetInfo configuration data (see root below).
- Thinking Mac-like.
First off, you never need to touch the other mouse buttons outside of X-Windows [editor: although you may find the right button very useful as its assigned to Control-Click by the OS]. Second, try to adopt Apple applications where they exist to replace you current favorites. For example, use the mail.app instead of pine or Eudora. Sure these have nice features, but long term, Apple apps will stay more tightly integrated: for example, mail.app links to Address Book which links to iCal. Third, chill-out dude. Macs force you to do things a certain ways with warning dialog boxes or focus-on-click windows. These are not worse than other ways, and long term you will come to see the benefits from the cross-application uniformity of operations. Unmount disks, especially network disks, by tossing them in the trash (you may want to add an eject button to the Finder menu).
- Viruses, Worms, holes, etc...
Regularly use the software update feature. Bugs get patched quickly. The only security holes you really need to stay on top of are Microsoft Internet Explorer holes, Microsoft Enoturage and Outlook holes, and Microsoft word macro viruses. Don't bother worrying about anything else until you worry about these. Many people use Chimera for this reason alone.
- Root
If you read just one book try "Mac OS X for UNIX geeks," most other books aren't for you because they are trying to explain UNIX to Mac heads. Avoid using root when you can use an admin tool or sudo instead. Apple has not fully documented root admin, so stick with tools. Except don't ever play with NetInfo Manager or niload until you have a lot of experience, as there is no faster way to make your Mac unbootable.
- Goodies
- There are virtual window managers at Apple's OS X downloads page.
- Try out Watson
- Microsoft office is a great program.
- Scientific plotting: You may like Igor from wavemetrics.com since it has both command line and menu driven interfaces. Fink comes with R, Octave and Gnu-plot. Mathematicians prefer mathematica.
- If you have a lap top, put the dock on the right and make it small.
- Turn off autostart on OS 9.0
- Discover iTunes.
- Consider a mac.com account
- Read http://macosxhints.com [Editor: And you're doing that now, right?!]
[Editor's note: Please feel free to add additional things to keep in mind, comment on things you disagree with, etc. This hint could become a great starting point for transitioning users...]
Comments (45)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021230053007256