Jul 29
Capture command line output directly to a text file
Cats: News|
If you're running a Unix command (inside Terminal or otherwise), and you want to quickly capture the standard output in an editable buffer (for examination or snipping), just add | open -tf after the command.
The output of the command will be placed into a new TextEdit buffer, stored in the /private/tmp folder. For example, to get the output of the command-line version of System Profiler into a text file, just type (in the Terminal window):
The output of the command will be placed into a new TextEdit buffer, stored in the /private/tmp folder. For example, to get the output of the command-line version of System Profiler into a text file, just type (in the Terminal window):
system_profiler | open -tf
You can then edit the document, and save it (use File ยป Save As to pick a save location). This method saves a step over using a redirect (>) and then opening the resulting file.Leave a Reply
You must be logged in to post a comment.
Subscribe
