Quantcast

Ian Osborne

Get extra mileage from your Mac using OS X's Terminal.

 

Terminal (in Applications/Utilities) gives you direct access to the UNIX system that underpins Mac OS X. By typing specific commands into your Terminal window, you can make changes, open settings, or access features that aren’t available by any other means.

After typing one of the commands listed here, press Return to activate it. Commands split over two or more lines should be typed in their entirety--don’t press Return halfway through. And bear in mind that some commands are case-sensitive, so be true to exactly what’s printed here. One final warning: All the tips in this feature have been thoroughly tested, but experimenting with the Terminal is not a task to be undertaken lightly. Don’t try to modify or adapt these commands unless you really know what you’re doing.

 

1. iRobot

 

Your Mac can talk to you. Using a robotic voice reminiscent of a 1950s sci-fi flick, it can ask after your health, tell you a joke, or say anything else you care to type. It’s a simple trick. Just open the Terminal application and enter: say Mac Life

And the Terminal robot utters the name of this magazine. Obviously it doesn’t have to be Mac|Life--type anything you like. Give it a go; it’s fun.

 

2. Back Up at Will

 

By default, Time Machine backups take place every hour, but you can change this through the Terminal. To make it back up every half hour instead, simply type: sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800

The 1800 at the end of this command is a half hour, expressed in seconds. You can change this figure to suit: For example, to back up once an hour again, replace it with 3600, and for two-hour backups, use 7200. Always remember to be especially careful with commands that begin with “sudo.” These are system-level commands that can cause huge problems if misused, which is why you’re asked for your administrator’s password the first time you try one.

 

3. Login Greetings

 

Another sudo (and therefore dangerous) command enables you to add a message to the login window. In the Terminal, type: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText “Your Message”

Replace Your Message with whatever it is you want to display, of course, but leave the quotation marks around it intact, and be careful with your punctuation. Some characters (exclamation points, for instance) stop the command from working.

To remove the message, type: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText “”

 

4. Play Games in the Terminal

 


A variety of simple games--like Pong--are accessible via the Terminal.


As you may know, OS X is UNIX-based. Emacs, a text editor, forms part of the UNIX system, and it contains some Easter egg games, including the ever-popular Tetris, Pong, and Snake. First you must find your Emacs version number. In the Terminal, type: cd /usr/share/emacs/

Press Return. Now type ls (lowercase LS) and press Return again. You’re given your Emacs version number (1.21, for instance). Write it down. Then enter the following: ls /usr/share/emacs/[VERSION]/lisp/play

Replace [VERSION] with the number obtained earlier (no parentheses). You get a directory of all the available games. Make a note, or take a screenshot. Now switch to Emacs through Terminal by simply typing emacs. To access the games, press Escape, then X, and type the name of the game you want to play before pressing Return. You can switch to the next game by pressing Escape, X, and the name of the next game. Have fun!

 

5. Fix Window Sizes in FFView

 

A. Resize Problem

 

FFView (www.feedface.com/projects/ffview.html) is a great sequential image viewer, perfect for comics, but its Pagewidth Mode resizes its window every time you turn to the next image. This is very annoying if you want to set--and stick to--your own window size.

 

B. Resize Resolution

 

Terminal solves the problem. Type: defaults write com.feedface.ffview udn_dont_resize_img_win 1

The window now remains a constant size. To reverse this, enter the code again, replacing the 1 at the end with 0. Now restart the app.

 

C. Want Comics?

 

There’s a wealth of downloadable free comics available on the web. For example, mobile comic publisher Robot Comics offers a list of high-quality, free-to-download material suitable for reading on your Mac with FFView. Check it out at http://tinyurl.com/dk8ell.

 

6. Get a Massive Dock

 

If you want giant-sized magnified Dock icons, enable Magnification in System Preferences > Dock, and in the Terminal type: defaults write com.apple.dock largesize -int 512; killall Dock

This increases their maximum size to 512x512 pixels. You can substitute another figure if you wish, but don’t go any higher than 512. To switch this effect off, just return to the Dock’s preferences and move the Magnification slider back.

 

Next: Terminal Tips Continued >>

COMMENTS: 12
COMMENTS
avatar

4 Terminal tips and 21 Hidden Preferences

I did a quick count and 84% of these tips are just hidden preferences. Sure the terminal is one way of changing those settings, but so are slick freebies such as the Secrets pref pane.

Love the Star Wars tip though, that one's awesome.

Here's a non-preference-related terminal tip: use SSH from another machine to kill misbehaving apps or semi-gracefully shut down a locked up machine. This would look something like

$ ssh other-machine
other-machine$ sudo shutdown -r now

Edit: 3 Terminal tips and 22 Hidden Preferences. Guess I miscounted.

Login or register to post comments
avatar

Recently used dock folder not working

hey i tried "14. Recently Used" but it's not working im running the latest Snow Leopard (10.6.4) does it not work for it?

Edit: meh it's ok after i entire a different command a ton poped up in my dock!

Login or register to post comments
avatar

LOL

Enable Debug Mode in Safari, make sure a window is open, go to Debug -> Show Page Load Test Window, click where it says "Suite" and choose URL. Click Start and watch what happens. A rare, strange but funny OS X easter egg!

Login or register to post comments
avatar

Really, really awesome!

Some of them I never known before. Useful for sure!

--------------------------------------
iPod transfer for Mac users
http://www.ipodmactransfer.com

Login or register to post comments
avatar

"robotic" voice?

What is meant by "Using a robotic voice reminiscent of a 1950s sci-fi flick"?? The default voice in Leopard & Snow Leopard is "Alex", which is, by all accounts, one of the - if not "THE" - best synthesis voices in the industry. See, for example:

http://watchingapple.com/2008/05/voices/
http://gwhiz.wordpress.com/2007/10/10/alex-speaks-out-on-leopard/

...for more details, as well as other usage ideas.

You can obviously choose other voices (including some entertaining "Novelty" voices) via the Speech preference pane, but out-of-the-box, your Mac certainly does not sound "robotic".

Login or register to post comments
avatar

URLs?

I go to the trouble of formatting the URLs with anchor tags, and the MacLife site STILL doesn't render them as clickable. Wonderful.

Login or register to post comments
avatar

lol

Enable Debug Mode in Safari, make sure a window is open, go to Debug -> Show Page Load Test Window, click where it says "Suite" and choose URL. Click Start and watch what happens. A rare, strange but funny OS X easter egg!
www.filmsinematik.tk

Login or register to post comments
avatar

Bookmarks transfered to my iPhone

I knew that the bookmarks were automatically transferred to my iPhone but my question is this. I recently got an iPhone for my wife. She noticed this and somehow deleted all of our bookmarks from our Mac. Short of typing each one back into the address bar is there a way to "reverse" the process?

Login or register to post comments
avatar

#14 Recently Used

I tried to do the Recently Used comman in terminal but when I executed it my Dock disappeared and my computer locked up. When I turn my computer off and back on the Dock is still not there and the computer continues to lock up. Can someone tell me how to undo this and fix my Dock?!

Login or register to post comments
avatar

How to fix the disappearing dock and locking up issue...

To fix the problem power off the computer. Restart in Safe mode (power on and hold SHIFT until the cog starts spinning). Select your profile. Open a new finder window and select your user name under places (ie the house icon). Open Library>Preferences and highlight com.apple.dock.db AND com.apple.dock.plist. Drag these files to your desktop. Restart your computer. Login like you usually do. Your dock should be back to normal and the computer shouldn't freeze up. Trash the 2 files copied to your desktop. If you open up the pathway again you will find they were automatically replaced. Many thanks to apple support for the advice.

Login or register to post comments
avatar

Login Greetings

Nevermind. I notice it is a typed message, not voice. Whatever!

Login or register to post comments
avatar

Games in Terminal

I have eMacs version 22.1. Is that compatible with the code you guys provided?

Login or register to post comments