Open Terminal Output Directly In TextEdit 4
Terminal
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.
Where To Next?
4 Responses to “Open Terminal Output Directly In TextEdit”
-
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
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
this is a nice tip.
I never thought how to get it.Thanks!
Comment By Fred on November 29th, at 3:26 am
-
4
Thanks a lot for providing individuals with an extremely special chance to discover important secrets from this web site. It is often very excellent and also full of a lot of fun for me and my office friends to visit your blog nearly three times a week to read through the latest guides you have. Of course, I am actually impressed considering the surprising opinions you serve. Selected two facts in this posting are really the most suitable I’ve had.
Comment By Patong beach on September 11th, at 5:29 am