Open Terminal Output Directly In TextEdit 3

Terminal

Open Terminal Output Directly In TextEdit

Hey

Every so often I show a couple of Terminal tips and tutorials which show you how to output Terminal text to a file. Most of the time it it done with the following syntax:

command >> /path/to/file.txt

What that command will do is output it to the end of the specified text file. The problem with this is that it is a bit long winded. Sometimes you may want to the text in TextEdit, but you don’t want it saved to a file. Instead of using the previous try the following instead.

command | open -tf

What this will do is output any text into TextEdit. Simple to use and very useful if you want to debug a script without having to save it to file.

If you want to take your skills with Terminal a bit further I recommend you check out the Terminal Category on this site. If you fancy reading a book there is a couple on Amazon that I regularly see mentioned and recommend, O’reilly Unix Geeks and Unix Under the Hood both are designed for Mac OS X and take Terminal further.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

3 Responses to “Open Terminal Output Directly In TextEdit”

  1. 1

    I would suggest using TextWrangler instead. It’s a free GUI text editor that includes a command line tool that makes editing text files and piping unix output to it very easy. For some things, like having a script pause while you enter some data in a file, then for the script to continue when you close the file, using TextWrangler is much more convenient than using TextEdit.

    Comment By dave on November 24th, at 10:31 pm

  2. 2

    You should use “open -f” for the default text editor or “open -e” for TextEdit.
    “open -tf” is an unnecessary overkill.

    Comment By Asmus on November 25th, at 1:46 pm

  3. 3

    this is a nice tip.
    I never thought how to get it.

    Thanks!

    Comment By Fred on November 29th, at 3:26 am

Leave a Reply

You can use: <a href> <h1 - h6> <acronym> <code> <em> <strike> <strong> <i> <b>