Skip to Content

Submit your nominations for the Luxist Awards' Best in Decor
AOL Tech

terminal posts

Filed under: Odds and ends, Terminal Tips, Snow Leopard

Snow Leopard Fixes: Terminal shell workaround

Ever since I installed Snow Leopard, I've been dealing with a particularly annoying bug. Terminal keeps forgetting my shell preferences.

I generally prefer to use tcsh rather than bash. This is mostly because I'm a technological dinosaur. I also have a lot invested into my ancient and extensive .cshrc that has taken years to grow and develop.

Normally, I set the default shell inside the Terminal app preferences. But there's a problem. Snow Leopard keeps losing my preferences for reasons I do not begin to understand. With this Snow Leopard bug, I had to find another approach for choosing my shell. Terminal preferences were no longer going to work for me.

There are actually two very good ways to handle this problem.

First, there's chsh, as pointed out by Richard Buckle and Brian "Shmit" this morning. A command line utility, chsh edits the OS X user database, allowing you to change a user's default shell. chsh is built into OS X, and you can pull up a man page to read details about its use. Supply the shell you want to use, authenticate, and you're set. There is, however, an easier solution.

It's System Preferences. As Bill Bumgarner and Jordan Breeding reminded me today, you can access advanced user settings by right-clicking (or Ctrl-clicking) a user name in the Accounts settings; then choose Advanced Options. (Please note that you must first unlock the settings before this trick becomes available.)

When selected, an Advanced Options screen appears. You can set the new login shell in this screen. A simple pop-up list offers easy access to all installed shells. Select the one you want to use and, once selected, click OK to dismiss the screen and return to the Accounts settings pane.

This solution works a lot better than the bash .profile approach I had been using for a few weeks. Running tcsh through the .profile initialization file had caused an extra layer of interaction each time I wanted to close a terminal window. The application warned me that I was about to kill a running process (i.e. my tcsh subprocess). Changing my default shell meant I could create and close windows on demand without that extra dialog, a welcome respite.

In conclusion, while I'm not sure why Terminal keeps losing its preferences, I'm pleased that I at least learned a way to bypass the shell issue. Hopefully, Apple will get this bug fixed soon.

Filed under: OS, How-tos, Snow Leopard

Snow Leopard Fixes: the angle-bracket "copy email" behavior

Snow Leopard introduced many welcome changes to Leopard and one huge annoyance. When copying an email address from Mail, Snow Leopard wraps the address in "< >" brackets, for example, "<annoying@email.com>". When pasting, you've got to go back and remove the brackets.

Mac Daddy World has identified the preference setting and posted the simple Terminal commands that will eliminate the brackets. I tried it and it's working perfectly! Thanks, Mac Daddy World. That was very simple and most welcome.

While most users are happy with Snow Leopard, there are these annoyances. Is there something bothering you?

Filed under: Tips and tricks

Force Snow Leopard's Dictionary.app to reuse definition window

The Dictionary.app in Snow Leopard has been driving me nuts. If you use LaunchBar or Spotlight (or probably any other method of sending a word to Dictionary.app), it opens a new window. And then another. And then another. This might be handy if the window bar was updated to show the word that you had looked up, but it doesn't, meaning that the extra windows are just clutter.

Before 10.6, Dictionary.app reused the same window for each new definition. If you wanted to go back to a previous word, you could simply use the "Back" button. As we've heard countless times, Snow Leopard has been about subtle refinements, but this was a step backwards to me. I was surprised that there isn't a Preference setting to reuse the same window or open a new one.

In a fit of frustration yesterday, I posted a bounty on Twitter and asked Rob Griffiths to see if he knew of an answer. Rob is the proprietor of MacOSXHints.com which I consider essential reading for Mac users (I have even submitted a few tips of my own over the years). I knew if anyone could find an answer, it was Rob.

Well, it turns out they don't call him Rob "The Hints Guru" Griffiths for nothing. Not long after my cry for help, Rob figured out how to Force Dictionary to show definitions in one window. As you might expect, it involves entering a command in Terminal.app while Dictionary.app is not running:

defaults write com.apple.Dictionary ProhibitNewWindowForRequest -bool TRUE

Voilà! Dictionary will now revert back to the 10.5 and earlier behavior of using one window for all definitions.

Rob must truly be credited for discovering this gem, because (as of this writing) Google comes up 100% empty when looking for 'ProhibitNewWindowForRequest'. When was the last time you tried to Google something and came up completely empty? That doesn't happen often anymore!

Turns out that Rob used another tip from his site to find hidden preferences (something else which has gotten more difficult in Snow Leopard). It's the circle of life... or at least, tips.

Thanks again, Rob. Now where do you want me to send your Ferrari? (You'll have to read Rob's post to get that joke. It also explains how to undo this change if you decide you want to revert to the standard 10.6 behavior.)

Filed under: iTunes, Terminal Tips

Change the behavior of the iTunes zoom button in 9

For me, one of the most welcome new features of iTunes 9 was the restoration of sanity to the way that iTunes responded to the zoom button. I had long been irritated by the non-standard behavior iTunes had displayed, brazenly flaunting the accepted practice of how the zoom button worked by toggling the mini player on and off, instead of zooming the window like a well-behaved Mac app.

Never once in all my years of using iTunes have I wanted to use the mini player. Whenever I tried to zoom the app and the mini player appeared, it would be quickly followed by muttering and grumbling. So you can imagine my joy and bliss at discovering that iTunes 9 finally validated what I had known all along. The zoom button was supposed to act a certain way, and if you want to do something different than the standard, then you ought to use the option/alt key.

I celebrated this change. I called friends I had not spoken with in ages to tell them about it. I wrote a sonnet to the proper use of the zoom button. A party was planned. Ok, maybe not all of that, but I was pleased with the change.

Then iTunes 9.0.1 came out and ruined everything. Yes, I said everything! No, you're the one who's overly emotionally attached to a relatively minor UI issue!

Well, apparently I'm not the only only one. Over on Twitter @zadr and @siracusa reported that you could revert iTunes 9.0.1 to iTunes 9.0's behavior through a command in Terminal.app:

defaults write com.apple.iTunes zoom-to-window -bool YES

This tip was then "retweeted" about 50 times and ended up on MacOSXHints.com which is where I first saw it, moments before breaking out into song and dance.

If you would prefer not to get into Terminal.app, you can get the 9.0 standard zoom behavior in 9.0.1 (and presumably later versions as well) by holding down the alt/option key when clicking the zoom button.

Filed under: Retail, Internet Tools, iPhone, App Review

Credit card terminals for iPhone

It's no secret that the iPhone is much more than just a smartphone. Apple has even started giving iPhones to Apple Store Concierge employees to schedule appointments and manage the store.

The ability to complete mobile transactions with credit card terminals is a great use of the iPhone for employees on the go or companies that do home or office calls. Like most applications in the iTunes App Store, there is no shortage of alternatives available for you to try. Here's a roundup of some of the most popular credit card terminals for iPhone.

Credit Card Terminal [iTunes Link] - $0.99
This app is pretty awesome. So awesome in fact, that it was featured internationally in an Apple commercial. The 99 cent application offers a (very) cheap alternative to expensive terminals and hardware. With a clean and easy to use interface, users can enter credit card information, complete transactions, and even view and refund past sales. The app also gives you the ability to collect customer information. The developer even offers telephone and email support and will walk you through setup.

Billing: Credit Card Terminal [iTunes Link] - $19.99
Another "easy to use" credit card terminal that is guaranteed to help make transactions easier. Sporting a pretty cool, and somewhat different kind of interface, the $20 application makes setting up a sale as simple as tapping a button. One cool feature offered in this version is the ability to get a customer's signature.

Some screenshots from the featured applications:

Continue readingCredit card terminals for iPhone

Filed under: Accessories, Hardware, Hacks, How-tos, Terminal Tips

Mac 301: Time Machine backups after your Mac's brain surgery

As I've discovered recently, one of the unfortunate side effects of having the logic board on your computer replaced (aside from the potentially hefty bill involved if your AppleCare has lapsed) is that your Time Machine backups won't play nicely with your Mac after the repair if you're using a Time Capsule.

Replacing the logic board is essentially like getting a whole new Mac; though all the data on the hard drive is identical, the new logic board will have different hardware identifiers (specifically, the MAC address) that will tell your Time Capsule, "This is a new Mac that's never been backed up before. Please treat it as such." The Time Capsule, doing as it's told, will fumble along and create a new Time Machine backup while ignoring the old backups completely.

Your options then are these:

1. Scrap your old Time Machine backups and start fresh. There may be an allure to this, but it's almost certainly unnecessary, and you can lose months of perfectly good backups. Plus, you then have to deal with the incredibly long first Time Machine backup all over again.

2. Hack your Time Machine backup using the following procedure, which will allow you to resume Time Machine backups as though your logic board was never replaced.

Continue readingMac 301: Time Machine backups after your Mac's brain surgery

Filed under: iPod Family, iPhone

3.0 firmware release expected at 10am PT/1pm ET, quick Terminal tip to check

Hey, iPhone 3G owners: Please do not download the 2,1 firmware files listed below. They are for the 3G S and will not work on your phone. Read the whole post for details. The correct firmware for the 3G will start with "iPhone1,2" instead.

If you were up all night waiting for the new iPhone OS to arrive, you're in good company -- we were too, until we began getting Twitter reports from users in Hong Kong and Sweden that the local carriers sent out SMS alerts to their customers suggesting when they could download 3.0. Those times both align with a 10 am PT/1 pm ET go time, and that's when we're calling it for now; Engadget concurs. That's why you're still seeing 2.2.1 as the most current version in iTunes; the new version hasn't been released yet.

Those with a command-line bent and an inability to wait without doing something can launch Terminal and type in the following every few minutes to see whether 3.0 has launched, rather than repeatedly clicking the Check for Upgrade button in iTunes (note that the up-arrow in Terminal reloads the previous command):

curl -s -L http://phobos.apple.com/version |\
grep -i restore |\
grep '_3.' | open -f

The results will look something like URLs ending with this:

iPhone2,1_3.0_7A341_Restore.ipsw
iPhone2,1_3.0_7A341_Restore.ipsw

The model number indicates which unit has downloadable firmware. As of right now, only the iPhone 3G S firmware has been updated. That's the 2,1 iPhone model. Yes, the 1,2 iPhone 3G model was considered a revision of the first generation 1,1 iPhone as it only had moderate hardware changes. The two iPods are 1,1 and 2,1 for the first and second generation.

(No, for those wondering in the comments, you cannot download the 2,1 firmware and install it on your iPhone or iPhone 3G -- it will only work with the 3G S.)

To download, copy the URL and paste it into Safari's download window or use any other favorite method to retrieve the firmware. Then hold the Option key and click Update in iTunes. Navigate to the firmware (the ipsw file), select it, and 3.0's good to go. Of course, you can also download directly through iTunes as soon as the update is available.

Filed under: Terminal Tips, Leopard

Terminal Tips: Rebuild your Launch Services database to clean up the Open With menu

TipsProblem: Some piece (or pieces) of rogue software have cluttered up your Open With contextual menu, which you can see by right-clicking or control-clicking any document in the Finder. This problem seems to be most prevalent with virtual machines that allow you to open documents with Windows applications, but tend not to clean up after themselves. After having both Parallels and VMWare installed on my MacBook Pro, my Open With menu was a mess.

Solution: Lucky for me, I noticed David Chartier's question about this on Twitter around the same time as I was wondering what to do about it. Some friendly person pointed him to a posting on Apple's discussion forum (also noted on Mac OS X Hints here and here), noting that running a specific command in a terminal window will rebuild your launch services, which repopulates the Open With menu with a current list of applications, without duplicates. It worked perfectly for me, but beware, on my system it took about 10 minutes to complete, and I suspect it could take more on a sufficiently gummed-up system.

Here's the Leopard version of the command (the path to the tool is different in Tiger, see here). I broke it into three lines for readability, but the \ at the end of the line is bash-speak for "keep on going with the same command" -- you can copy and paste it directly and it should work, or if you type it on one line without the backslashes, it will also work fine.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill\
-r -domain local -domain system -domain user
If, preferring to avoid the Terminal, you want a handy GUI app to rebuild the Launch Services database with a couple of clicks, check out Titanium's OnyX or Maintenance utilities, both free of charge.

Filed under: Terminal Tips, TUAW Tips

TUAW Tip: Moving your home folder to another disk (or moving it back)

In ye olde times, with "Mack OSe 9," many users chose to keep their personal files, work, and documents on a different physical disk from their startup disk. It was a safety measure: If one disk goes down, at least the other won't. There was no structural reason to keep files in a particular disk location, other than keeping them out of the System Folder.

I visited a client yesterday whose drive scheme was set up exactly like this, and he wanted to be (finally) upgraded to Leopard. I wasn't sure how Leopard would handle the fact that his Users folder had been moved to a different drive, so (knowing I had backups of his entire system) I cautiously proceeded with the installation.

After the installer finished, Leopard had created a fresh, blank Users folder on the startup disk with a home folder bearing the same username. This wasn't exactly the answer I was looking for. I had to link, somehow, the new Users/hisname folder with his existing user folder on the other volume.

Turns out, Leopard handles this much better than previous versions of Mac OS X. Read on to find out how.

Continue readingTUAW Tip: Moving your home folder to another disk (or moving it back)

Filed under: Software, iTunes, Ask TUAW, Leopard

Ask TUAW: tracking your iTunes purchases, quitting processes, doing a clean OSX install and more

Once again, it's time for another edition of Ask TUAW: the place where we try to answer all of your Mac and Apple-related questions. This week we're taking questions about tracking your total iTunes purchases, forcing processes to quit, doing a clean install of OSX and more.

As always, we welcome your suggestions for this week and questions for next time. Please leave your contributions in the comments for this post. When asking questions, please include which Mac and which version of OS X you're running. If you don't specify, we'll assume you're running Leopard on an Intel Mac.

Dima asks:

I would like a way to require a password when the computer wakes from sleep, but not to require a password for just the screensaver. Is there a way for me to accomplish this?

The only way I know of to accomplish this would be to modify the plist file for the screensaver via the Terminal. However, unless this is really important to you, I would not advise doing it. If you want to do it, proceed at your own risk.

Either way, here's the command to enter in the Terminal if you want to try it.

defaults -currentHost write com.apple.screensaver askForPassword -int 0

This will set it so the computer only asks for a password after waking from sleep and not after the screensaver.

Frank asks:

In my finder window, next to my drive's name, there's a number in parentheses. it used to be a (2), but recently it changed to a (3). What does this number mean?


Continue readingAsk TUAW: tracking your iTunes purchases, quitting processes, doing a clean OSX install and more

Filed under: Software, How-tos, Tips and tricks, TUAW Tips

TUAW Tip: Stop Backup.app from bouncing

TJ Luoma recently shared the solution to an annoying problem. Specifically, he wanted to keep Backup's icon from frantically jumping in the Dock like so many hepped-up toddlers in a bouncy castle. The Backup icon typically bounces in the Dock for a minute two before it even begins backing up any data.

We know what you're thinking, "Just go to the application's preferences and disable the Dock animation." The problem is that Backup has no preference pane! Fortunately, TJ found a fix.

While browsing "defaults read com.apple.backup" in Terminal (as suggested by a Twitter helper), he found
"Backup Timer" = 120
Realizing that's how long the app is supposed to wait (and toss its icon up and down) before executing a backup, he entered
defaults write com.apple.backup "Backup Timer" 1
which forced it to bounce only once. Alternatively, you could install Dockless, which prevents running apps from showing up in the Dock (or vice versa). Check out TJ's post and enjoy!

Filed under: Terminal Tips

Terminal Tip: Enable half-star ratings in iTunes

Do you like giving ratings to songs in iTunes? If so, then you've probably noticed that you are only able to rate songs on a full-star basis, not enough granularity for some music fans... there's a longstanding AppleScript hack to enable half-stars, but now there's an easier way around this issue. Macworld's Rob Griffiths found a work around, involving a simple Terminal tip to enable half-star ratings.

To enable half-star ratings, close iTunes, and open Terminal (/Applications/Utilities). Once you have Terminal opened, type the following command and press enter:
defaults write com.apple.iTunes allow-half-stars -bool TRUE
When you reopen iTunes and rate a song, you will be able to give half-stars. That simple. If you wish to make things normal again, open Terminal and type the same command, replacing "TRUE" with "FALSE."

Filed under: Terminal Tips

Terminal Tip: Enable Safari web inspector


Perhaps you are a web developer, or maybe you're just nosy. Either way, looking at certain websites' CSS, HTML, and Script documents can be fun. If you are a Safari user, you can easily look at the loading documents in the Activity View (Window > Activity), but what if you want to take this a step further? You can with the Safari Web Inspector, and you can do it by enabling the Safari "Develop" menu.

To enable the Safari Develop menu, just close Safari and type (or copy/paste) the following command into Terminal.app (/Applications/Utilities):

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

Once you enter the command, you will be able to launch Safari, load a webpage, and click Develop > "Show Web Inspector" to see the page attributes. You will be able to see the documents, stylesheets, images, and scripts.

Update: As of new versions of Safari, you can enable the Develop menu by going to Safari > Preferences > Advanced, and click on the "Show Develop menu in menu bar." Thanks to everyone in the comments for pointing this out!

Want more tips and tricks like this? Visit TUAW's Terminal Tips section today!

Filed under: Terminal Tips

Terminal Tip: Change Time Machine backup interval

Sometimes you want your Mac to be backed up more frequently than usual. If you want to instantly back up using Time Machine, you could click on the menu bar item and select "Back Up Now," but what if you want to change the backup interval indefinitely? With this Terminal Tip, you can do just that.

Time Machine is set to automatically back up every hour, but if you would like to change it to every half hour, you can use the following Terminal (/Applications/Utilities) command:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800

You will need to authenticate as an administrator, since this command is run under a "sudo." The time interval is measured in seconds, so you can enter any time you wish there; just make sure it is in seconds. By default, Time Machine backs up every 3600 seconds (every hour). If you wish to revert to the original, just replace "1800" with "3600."


Want more tips and tricks like this? Visit TUAW's Terminal Tips section!

Filed under: Terminal Tips

Terminal Tips: Enable "path view" in Finder

When you open a Finder window and start browsing to a folder, do you lose track of the path to that folder? If you do, the Terminal command below will enable path view in the Finder -- this means that you will see the directory path to the current folder you are browsing in the title bar, instead of only seeing the name of the current directory.

To make directory paths visible atop Finder windows, open Terminal.app (/Applications/Utilities/) and type the following command:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

Once you run the above command, you will also need to restart the Finder, so you can either type "killall Finder" and hit return, or use the Force Quit option under the Apple menu to relaunch it. The Finder will restart, and you will start seeing the paths to directories in the title bar.

Update: As some have pointed out in the comments below, this Terminal command will only work with Mac OS X Leopard (version 10.5).
Ups

Want more tips and tricks like this? Visit TUAW's Terminal Tips section!

Tip of the Day

To get an instant map to any address, just go to your Address Book and right click on the address field of any one of your contacts and select "Map Of." The address will then be revealed in Google Maps on Safari. You can do the same if a data detector determines there is an address in an e-mail in Mail.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher