command line

Latest

  • Open man pages from Xcode

    by 
    Mike Schramm
    Mike Schramm
    07.30.2007

    Toxic Software's posted a useful little script if you spend any amount of time in Xcode-- because manopen is having trouble with Leopard, John punched up a shell/Applescript to open man pages directly from within Xcode's command line. It's tiny (and doesn't really do much-- just opens an Xcode Help menu item), but it seems useful-- straight from the command line, you can break out the man page within a GUI, and just keep right on coding.Because the script uses UI scripting, you've got to enable an option in Universal Access preferences, but then just toss the script in your PATH and you're good to go. I can't imagine it's hugely relevant for everyone out there (I haven't put anything together from the command line in Xcode in a while), but anyone building stuff there will probably appreciate it.And if viewing pretty man pages from the command line is your thing, Atomicbird Software came up with a script that breaks out man pages in PDF form. If you love working from the command line but love reading man pages in something a little easier to browse, today's your lucky day.

  • Terminal Tip: Interactive Command-line File Encryption

    by 
    Erica Sadun
    Erica Sadun
    05.22.2007

    In OS X, you can always toss a file onto the command line instead of laboriously typing out a complete path name because Terminal supports drag and drop. Over at Murphymac, Murphy has posted a video showing you how to create a shell script using DES3 encryption to protect your files. It takes advantage of this drag and drop support so you can basically run the script and drop the file you want to encrypt. Even if you're not all that interested in encrypting your files, this videocast shows how to think about creating shell scripts with a particularly interactive OS X flare flair.

  • Terminal Tip: Output man pages as plain text with col

    by 
    Erica Sadun
    Erica Sadun
    04.19.2007

    Ever try to open a man page in TextEdit using man | open -f? You end up with the kind of unreadable repeated characters shown here. This all dates back to the days of dot matrix and daisy wheel printing when the only way you could produce bold type was to repeatedly print characters. Fortunately, there's an easy way to convert man pages into simple, non-redundant text. Use the command-line utility col with the -b flag enabled. For example, man col | col -b | open -f will open the col man page in TextEdit without repeated characters. The -b flag tells col to exclude all but the last character written to any column, ignoring any backspaces and repeats.

  • Sudos and sudon'ts

    by 
    Erica Sadun
    Erica Sadun
    03.21.2007

    I find that I'm visiting RixStep on a regular basis these days. Today I stumbled across this post about using root privileges and thought I'd share it with you. If you want to learn more about using Mac admin privileges, this might not be the best post to start. If you already have some familiarity with the command line and with Unix, you can learn more about what su does, how to authenticate yourself, and understand why this affects security in a handy ten-point check list. It's a little verbose, but there's a lot of good meat in the article.

  • 15 Nifty command line tricks to set various options

    by 
    Erica Sadun
    Erica Sadun
    03.20.2007

    UK website MacOSXTips has put together a list of 15 of their favorite command line preferences tricks. The tricks, which all use the defaults command, range from deactivating Dashboard, to showing hidden files in the Finder, to displaying all mail as plain text. I had a blast rediscovering some old preferences tricks and learning some new ones.

  • Monday man page: curl

    by 
    Michael Rose
    Michael Rose
    03.05.2007

    Today's man page covers one of my favorite utilities: curl. No, it's not a haircare product -- it's one of the most flexible download tools in the kit bag, with the ability to handle almost any protocol that can be addressed via a URL (hence the name, short for "client for URLs"). If there's a server out there that's reachable via HTTP, HTTPS, FTP, SFTP, SCP, and lots of other alphabet soup, curl can talk to it. curl http://www.tuaw.com/2007/03/05/monday-man-page-curl/ -- display the source of this very article in Terminal curl ftp://ftp.panic.com -- list the contents of a remote FTP site, in this case one with a pretty good FTP client curl -o ~/Desktop/curl-man.html http://curl.haxx.se/docs/manpage.html -- copy the curl manpage to your desktop; if you use capital -O, the local file mirrors the remote filename curl has an excellent usage manual at its site, detailing examples of use and advanced techniques. While there are zillions of ways to use curl in site testing, analysis and uploading, my favorite way of using it is as a quick file downloader. Read on for the details.

  • Monday man page: open

    by 
    Michael Rose
    Michael Rose
    02.12.2007

    Just a quick hint for today's man page: the open command does just what you might think. It opens files, directories, applications or URLs; no muss, no fuss. For files, you can specify an application to open them with the -a flag (or just trust LaunchServices to pick the right app). If you want to, the -e flag will force them to open in TextEdit. open ~/Desktop/MyWordDoc.doc [will open in MS Word] open -e ~/Desktop/MyWordDoc.doc [will open in TextEdit] open ~/Desktop/*.doc [opens every Word document on the desktop, in Word] open http://tuaw.com [well, give it a go!] I use open in installation scripts or other situations where I want a GUI application to come up at the end of a process. For example, open /System/Library/CoreServices/Software\ Update.app/ launches Software Update and begins checking for available patches. Sure, you can force an update with 'softwareupdate -i -a' anytime, but maybe I want to give the person sitting at the console an opportunity to select the updates needed, or cancel out of the possibly-lengthy update cycle until it's more convenient. You could also use the URL functionality to take people to a 'readme' website... the possibilities are manifold.

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

  • Disk Order - an advanced Finder replacement

    by 
    David Chartier
    David Chartier
    06.01.2006

    Disk Order is another app that takes a stab at replacing the Finder, but doesn't seem to take things quite as overboard as PathFinder. With tabbed file browser windows, built-in FTP client, command line tools and more, Disk Order should have a few things to offer anyone who feels like the Finder is the ugly duckling of Mac OS X.A full-featured demo of Disk Order is available, while a license costs $22.57.[via MacMerc]

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