Print out terminal results of any commands to TextEdit (OS X)

Following that tip on Tuaw that I forgot about (good old banner), it reminded me that copy paste from terminal is overrated.

To print out to TextEdit straight away, all you have to do is ‘pipe’ the result to ‘open -f’

examples:

# will list directory to TextEdit
ls -al | open -f

# will print out the results of 3 pings to domain.com to TextEdit
ping -c 3 domain.com | open -f

# will return all processes running on the machine to TextEdit
ps aux | open -f

# will output the source of a file to TextEdit
cat filename | open -f

# will list all the .DS_Store files in current (and recursive) directory(ies) and output to TextEdit
ls -alR | grep .DS_ | open -f

Note that the last one double pipes… ‘grep’ is a filter that will retain and display only the lines that have .DS_… then it’s piped to TextEdit.

That’s it, cheers.

Related



About this entry