A few years ago I switched from Windoze to Mac. I had several motivations, but it's not obvious that those matter for someone reading this page. What does matter is what I learned after I made the switch: for an empirical social scientist, Mac is a much, much better operating system. The rub is the fixed cost of learning how to use a new operating system. This page is a combination of (a) tips for getting over the hump in terms of how to do stuff you used to know how to do on the Windoze side, and (b) tips on stuff you previously couldn't do. This post is partly me trying to contribute to the greater good, but also partly me keeping track of what I've done on my Mac, just in case someday I drop my laptop and forget how to customize everything. 1. Talking to a Linux machine On Windoze, I always found the software for connecting to a Linux machine to be a bit slow and glitchy. On Mac, it is really easy and seamless. The Mac operating system is a type of Linux, so lots of stuff is there that you wouldn't know about if you were busy with the mouse. Open up the Terminal application (the easiest way to do this is to use Spotlight--press Apple-SpaceBar and type in Terminal, and you will be shown the Terminal Application---which generally is a really quick way to launch any Application). Then use the command cd .ssh to change into the ssh directory. Using your favorite editor (mine is emacs, which is native for the Mac), create a file called config. My config file has the following lines: ------------BEGIN CONFIG FILE LINES-------------- Host = m HostName = mymachine.berkeley.edu User = myloginid ForwardX11 = yes ForwardX11Trusted = yes Compression = yes Cipher = blowfish ServerAliveCountMax = 5 ServerAliveInterval = 20 TCPKeepAlive = no ------------END CONFIG FILE LINES-------------- Save the file and exit the editor. Then you can use the command ssh m and the ssh program connects to mymachine.berkeley.edu as user myloginid and you are prompted for your password. The connection includes X-windows, so that you can use interactive Stata and check out graphs in Matlab, and so on. Good stuff. Realistically, my main use of my Mac is as a dumb terminal for my Linux servers. Another aspect of talking to your Linux 2. LaTeX and TeXShop and Screen These days, I use TeXShop for the Mac using emacs as an editor (I don't particularly like the TeXShop default editor; for example, in emacs I end up issuing Esc-q about every minute to re-justify the paragraph I just edited). To use this setup, you want to go to Preferences within TeXShop and select (under the Source tab) "Configure for External Editor" and select (under the Preview tab) "Automatic Preview Update". To edit myfile.tex, I open up two Terminal windows. The first one runs emacs for editing myfile.tex and is big. The second one is just there for compiling myfile.tex to produce myfile.pdf and is small. The first command I issue in the second window is open myfile.tex which compiles opens up myfile.pdf using TeXShop. The second command I issue in the second window is either pdflatex myfile.tex to compile, or (if I know I am going to be making lots of edits and want to watch the impact of my edits) latexmk -pvc -pdf myfile.tex which looks at myfile.tex to see if it has changed recently and if so compiles it (including bibtex). The only thing I don't like about this last option is that every time you save, latexmk compiles, which means the focus moves away from the editor and is placed on the preview window. To solve that, issue once defaults write TeXShop BringPdfFrontOnAutomaticUpdate NO and then restart TeXShop. (I found this tip after some googling and never bothered to figure out where this is located within Preferences in TeXShop.) Also, a related convenience is to issue once defaults write com.apple.Terminal FocusFollowsMouse -string YES and restart Terminal. Then if you move your mouse over the Terminal window, the focus is back on that window. This is nice for those of us who are used to X11 Linux environments. Sometimes I find that this setup is a bit distracting with the multiple versions of Terminal running. A cleaner solution is to use screen, which is an awesome program that is native to your Mac. Screen kind of creates tabs for your Terminal application. To get introduced to screen, create a file called .screenrc in your root directory. For example, type emacs ~/.screenrc and then include the lines: ------------BEGIN .screenrc FILE-------------- termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' startup_message off hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " screen -t random 1 bash screen -t latexmk 2 bash screen -t emacs 3 bash escape ^Gg ------------END .screenrc FILE-------------- Then save the file (C-x C-s) and exit (C-x C-c) emacs. Then type screen You will see a color coded bottom of your screen with 3 tabs. The first tab is labeled "random", the second is labeled "latexmk", and the third is labeled "emacs". emacs is in red, indicating that it is the current tab. I use that tab to edit my document. You toggle between the two most recent tabs using C-g C-g. If you want to move to tab 1, C-g 1 does the trick. I get to the latexmk tab (e.g., C-g 2) and issue open myfile.tex latexmk -pvc -pdf myfile and then hop back to the emacs tab and start writing. Note that screen is also a really useful way of customizing a session on a remote machine that you are connecting to. You can log onto that machine, run screen to set up 200 tabs, all customized for how you like to work, "detach" the screen session using screen -d and logoff. Your screen session keeps running, even though you've logged off. The next time you log on, type screen -ls and you get a list of the screen sessions you are running. For example, I am currently running a screen session 236.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (Detached) (please pardon the redaction). I can "re-attach" to my screen session with screen -r 236 Once you get used to screen, you can't imagine working any other way. 3. Dropbox I store pretty much all of my LaTeX documents on Dropbox these days. It is rare for those files to get overly large, so I haven't had need of anything but the free service. I work in the office, in coffee shops, and also from home, so this spares me lots of hassle moving files back and forth. 4. Matlab Matlab is frustratingly slow to load with all the bells and whistles. From the Linux prompt, call matlab -nodesktop -nosplash -logfile tmp.log The first time you call this on a given machine, it takes 5-10 minutes to load. Subsequent calls on the same machine load up in about 5-10 seconds. This stores the results of your session in tmp.log. 5. Find One of the commands I find myself using most frequently is find. This works for both my Linux machines and my Mac. For example, I might remember that a long time ago I wrote a Stata do-file that did some clever graphics trick involving the legend option. My brain is a sieve, and I don't remember what project (stuff like this happens to me all the time). I open up a Terminal window and issue the command find . -name "*.do" -exec grep -H "legend(" '{}' \; -print You get a recursive list of all Stata do-files containing the snippet "legend(". By recursive, I mean that the command looks not just in the current directory, but also within all subdirectories of the current directory, and all of the subdirectories of those subdirectories, and so on. Very powerful if you are forgetful. 6. open Say you have files called file1.pdf, file2.pdf, file3.pdf, and so on. Then you can issue the command open file*.pdf and Mac opens up a preview window with all of the files concatenated into one pdf. This is kind of a quick and dirty version of the amazing program pdftk, which I strongly recommend downloading. This works great on a Mac and on Linux and allows you to do stuff like create---from the command line---a pdf containing pages 11-17 of one document and pages 8-9 of another document. I use this in creating web appendices where I want a "paper trail" of how I created the web appendix (surely by the time I hear back from the journal I will forget how I did it and which version of the figures I was using...). 7. terminal stata I like being able to open multiple versions of stata at once. So I set up my bashrc file as follows: ------------BEGIN .bashrc FILE-------------- alias ll="ls -lG" alias stata="/Applications/Stata/StataMP.app/Contents/MacOS/stata-mp" alias xstata="/Applications/Stata/StataMP.app/Contents/MacOS/StataMP" ------------END .bashrc FILE---------------- That way, I can call stata from a terminal window just by issuing the command stata and get an "old school" DOS version of Stata running, and I can do so as many times as I like (useful for tinkering while a slow program is running and also for parallel programming). If I want multiple versions of GUI Stata running, I can do so by issuing the command xstata & I find I use the terminal version almost exclusively, but there are times when I want to tinker with graphics options and the like and for that I prefer the GUI.