terminal

Latest

  • Trigger backups on connect with launchd

    by 
    Michael Rose
    Michael Rose
    12.25.2006

    The fine folks at macresearch.org have put out an interesting tutorial that walks through setting up launchd and rsync to do automatic backups whenever a specific external drive is mounted. Loyal readers may note that this is similar to the core feature of Martian Lifeboat (which should not be confused with Mojave Shade's Lifeboat, as mentioned in several comments). The script, however, is free; Martian Lifeboat is not.Although the currently published script leaves out the crucial -E flag to force rsync to copy resource forks (credit to Josh Wisenbaker of afp548.com for spotting the silent E), it's still a good primer on the power of launchd. For a simple way to create your own launchd configuration files, be sure to check out the powerful, open-source and free Lingon utility. If you try this out, let us know how it works for you.[via macenterprise mailing list]

  • 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...

  • The "Lost" prompt

    by 
    Erica Sadun
    Erica Sadun
    12.07.2006

    Blogger David Winter has a posted a cute how-to showing you how to change the prompt in your terminal to the ">:" used in Lost. Basically, you update your .zprofile or .bashrc or .kshrc to include the line export PS1=">: ". Me? I'm a csh weenie. I'd have to use set prompt=">: " to get the same effect. (The same thing applies for tcsh users.) Winter also includes instructions on how to get the green-on-black color settings used in the program. 4 8 15 16 23 42 and all that.

  • Spotlight from the Command Line

    by 
    Erica Sadun
    Erica Sadun
    11.28.2006

    0xFE (pronounced "254" I suppose...) has a very nice how-to up showing how to use Spotlight metadata to find files from the command line. The post shows how the mdfind command goes beyond find, locate and various grep hacks to create flexible and powerful queries. Surprisingly enough, I couldn't find an mdfind man page (mdutil was there) but the mdfind command worked fine for me in Terminal. A typical mdfind command goes something like mdfind Sadun, where Sadun is the search word. To limit the search to a particular folder use the -only flag. mdfind -only ~/Desktop Sadun. The mdls command displays the metadata associated with a specified file. e.g. % mdls Television\ copy.jpg Television copy.jpg ------------- kMDItemAttributeChangeDate = 2006-11-29 11:10:52 -0700 kMDItemBitsPerSample = 32 kMDItemColorSpace = "RGB" kMDItemContentCreationDate = 2006-11-29 11:10:19 -0700 kMDItemContentModificationDate = 2006-11-29 11:10:19 -0700 kMDItemContentType = "public.jpeg" kMDItemContentTypeTree = ("public.jpeg", "public.image", "public.data", "public.item", "public.content") kMDItemCreator = "Adobe Photoshop CS2 Macintosh" kMDItemDisplayName = "Television copy.jpg" kMDItemFSContentChangeDate = 2006-11-29 11:10:19 -0700 kMDItemFSCreationDate = 2006-11-29 11:10:19 -0700 (...and so forth...) It's a great post that goes into far more detail and is well worth a careful read.

  • 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.)

  • Unix tips for your Mac

    by 
    Scott McNulty
    Scott McNulty
    05.18.2006

    Benjamin Han has compiled a list of Unix tips for people who don't know their MAN from their pids. He covers the gamut from backing up files, to reloading Cisco VPN kernel extensions, to sending email from the command line.This is a great way to start the journey to command line jockey.

  • Tips on removing apps from the Sync Services database

    by 
    David Chartier
    David Chartier
    04.27.2006

    If you've ever installed an app that can take advantage of .Mac syncing services and then stopped using it or removed it for one reason or another, you might have noticed that its listing in the .Mac System Preferences pane still lingers. This could be a nuisance to neat-freaks, but it could also cause complications in some cases.Fortunately, a post at macosxhints has done some digging into the matter and revealed a few clues to cleaning up the mess. It turns out that Panic, makers of Transmit, offer a Terminal tip for removing Transmit from the .Mac sync services list. This inspired the macosxhints poster to do some digging to see about other services, so check out their post if you're looking to do some .Mac sync services spring cleaning.

  • Beat your Mac into submission

    by 
    Scott McNulty
    Scott McNulty
    04.14.2006

    Sometimes, even on a Mac, applications go a little wonky. They stop responding, they freeze, or you are treated to everyone's favorite sight: the spinning beachball of death. Ted Landau has compiled a quick list of something things that you can do quit a misbehaving program, or to speed up Safari.Even after all that, once in awhile an application refuses to die and one must delve into the strange, and frightening world of the Terminal, however, Ted doesn't cover that.

  • Switch iTMS countries via the command line

    by 
    Scott McNulty
    Scott McNulty
    04.13.2006

    I think we can file this one under 'Just because I can.' Erica Sadun has written a perl script that allows you to change your currently selected country in the iTunes Music Store. Both iTunes and Safari have to be open for this script to function.If you aren't a Terminal jockey you can just pop open the iTunes Music Store and choose your country from the pop up menu at the bottom of the main page, but who likes using GUI's anymore?

  • Create an OPML from Safari RSS feeds

    by 
    David Chartier
    David Chartier
    02.09.2006

    MacOSXHints has a simple trick for creating an OPML file, completely with folder structure/groups, from your RSS feeds in Safari. The tip basically involves downloading an XML stylesheet the author created, and using it in a Terminal command to generate the OPML file.I'm glad someone found a way to put this together, but with the open standards and portability of RSS and newsfeeds, I think it's kinda bad form on Apple's part to not have baked this ability into Safari already. Nevertheless, MacOSXHints has come to the rescue, yet again.

  • GLTerminal for OS X

    by 
    Fabienne Serriere
    Fabienne Serriere
    02.01.2006

    I'm a Mac girl who spends most of her time hanging in the terminal, so you may say old school stuff makes me happy. If that's the case, then I'm jumping for joy at the extra old-schoolness of this GLTerminal port for OSX.As if my use of terminal-based chat centericq weren't enough, I have put a screen shot of centericq running in this "classic" amber terminal using GLTerminal on my OS X box. Yum.If you want to make this work, in GLTerminal go to Preferences -> Renderer -> Plugin and choose "Classic Terminal" and your Phosphor Color of choice (white, matrix green, or amber). Also, don't forget that to jump out of full screen mode you will need to use command-return.[via BoingBoing]

  • Disable and stop the Dashboard

    by 
    Dave Caolo
    Dave Caolo
    01.14.2006

    Here is a great video podcast [link] that demonstrates several ways to either stop or disable the Dashboard. The author demonstrates both getting the job done via the Terminal as well as with a couple of double-clickable utilities he has written. It's a well done screencast and quite informative. Check it out.

  • Terminal Tips: Lynx

    by 
    C.K. Sample, III
    C.K. Sample, III
    05.27.2005

    The UNIX and Open Source section of Apple's Mac OS X Downloads site features Lynx today. Lynx, as well as Links (another favorite of mine), is a Terminal-based, text-only web browser. Why would you want to use such a thing, you ask? Well, because since it simply ignores all non-text items in a webpage, the browsing experience is lightning fast compared to most modern browsers. When you download the disk image, you'll find that if you follow the installation instructions, Lynx won't work. In order to correctly install Lynx, drag lynx.command to your Applications folder, as the README file instructs you to do. Now, launch your Terminal (located in /Applications/Utilities/) and type open /usr/local/lib/ at the command line and hit enter. Now drag the lynx.cfg file from the Lynx disk image into the lib folder window that pops open. A dialog box will pop up warning you that you do not have permissions to write files to that folder. Click the Authenticate button and enter your Administrator password when prompted. Now, simply close the window, navigate to lynx.command in your Applications folder and double-click it. Or, if you already have the Terminal open, you can simply type /Applications/lynx.command; exit at the command line. Lynx will open in the Terminal. Now, simply type g (for Go) to get a prompt where you can type in a web address of your choosing. Tab will tab you through links on pages. Return or the right-arrow will take you to the highlighted link. The left-arrow will take you back to the previous page, and hitting q will quit the browser. Easy. Have fun!

  • Terminal Tips: Say

    by 
    C.K. Sample, III
    C.K. Sample, III
    04.27.2005

    Have you ever wanted to have your Mac convert a document / news story into an audio file so that you can listen to it on your iPod, but didn't want to spend the money on a high cost program to do it?  Well, it just so happens that OS X has a very powerful text to speech engine that is easily accessible via the command line.  Simply launch the Terminal (located in /Applications/Utilities/) and type say -f pathtotextfile -o ~/Desktop/convertedfile.aiff, substituting the path to the text file you want to convert for pathtotextfile and the name you want for the resulting audio file for convertedfile, and hit return. Your Mac will read the file into an AIFF audio file on your Desktop using the Default Voice and reading-speed settings you have set up in your Speech control panel in the System Preferences. It may take a while to write the file, as it reads in real time.  Once it is done you will be returned to the shell prompt.