TerminalTips

Latest

  • Monday man page: dig, host & nslookup

    by 
    Michael Rose
    Michael Rose
    01.29.2007

    For this week's Monday man page, it's a triple threat: dig, host, and nslookup. All three utilities are included with the BIND (Berkeley Internet Name Domain) version 9 package, part of every Mac OS X 10.4 installation, and all three do pretty much the same task: translate hostnames to IP addresses and vice versa. In 10.3.9 and earlier, the Network Utility 'lookup' tab was a front-end for nslookup, with an option via checkbox to use dig instead; starting in 10.4 the checkbox is gone and the utility is dig-only. If you want a good introduction to how DNS works, the MacDevCenter has an excellent primer, and I can also heartily recommend DNS and BIND, possibly the most comprehensible book about a complicated subject that I've ever read. After the jump, we'll talk a bit more about how DNS lookup tools are useful, and why you might prefer one of this troika to the others.

  • Monday man page: ls

    by 
    Michael Rose
    Michael Rose
    12.18.2006

    There are two kinds of Mac folk: them that finds this "Terminal" thing strangely fascinating, and them what considers it the worst kind of wicked magic, not to be trifled with. Here at TUAW we've got all kinds, and for anyone who might be curious about the power and possibilities of the command line, we're going to provide some weekly quick tips and suggestions for introductory use. Always keep in mind, though, that the damage you can do from Terminal is effectively unlimited, especially with administrative access. Best to play around in a 'dummy' account until you have your sea legs.Even before we start, an explanation of the title: 'man pages' are the BSD UNIX manuals, already tucked away on your Mac. You can type "man command" in Terminal for a detailed (not to say overwhelming) rundown on any command-line tool. As we've mentioned before, an excellent intro to Terminal in Tiger can be found over at the O'Reilly Mac Dev Center. We also posted about Unix for the Beginning Mage, an amusing beginner's guide to the plumbing under Mac OS X.Our fine feathered friend today is 'ls' -- the UNIX directory list command. Read on for more...

  • 10 Little Known Command-Line Utilities

    by 
    Erica Sadun
    Erica Sadun
    11.23.2006

    OS X Daily has a nice list of OS X command-line utilities today that you may have forgotten about or might never have encountered. For example, the article suggests using ifconfig to check your IP address or lsbom to peek at the contents of an OS X installer package. If the notion of extending your command line vocabulary appeals, it's worth a visit to this quick article. You might pick up a trick or two you can incorporate into your day-to-day routines.

  • Terminal Tip: Keep your Mac portable from waking when the lid is opened

    by 
    Laurie A. Duncan
    Laurie A. Duncan
    10.09.2006

    Although I'm a Mac Geek by trade, I tend to avoid the terminal unless I'm out of other options. I'm a GUI kind of girl. It's the Mac OS that I love, not its Unix underpinnings. I appreciate the power of the command line - I just don't want to spend all day there. Still, once in a while I come across a tip like the one, which Glenn Fleishman posted in the most recent TidBITS, and I find myself unable to resist the urge to fire up the Terminal. This tip solves a problem that I've experienced myself and many of my clients have complained about - laptops waking from sleep while in their cases because the latch won't keep the lid closed. This can cause overheating, which can lead to a variety of other problems, like hard drive failures, etc. My solution is, of course, to fix the latch! But there are times when that isn't convenient and even if it's convenient it doesn't happen often enough for some people to even bother stressing about it. By harnessing the power of pmset, the command line app that controls power management settings, you can fix it so that your sleeping beauty stays asleep, even when the latch isn't doing its job.The command is an easy one - a single line. Ready for it? sudo pmset lidwake 0 By setting the lidwake value to 0 you prevent the machine from waking until you tap a key on your keyboard, and since the value gets written just to a plist file, it takes hold right away. Of course you'll need administrator privileges since you'll be asked for an admin password before the command is executed.For more pmset options, have a look at the "man" pages at Apple's Darwin Reference library, or open your Terminal and type "man" (without the quotes), hit return and then type "pmset" (without the quotes.)