OS X command line tricks for SSH and serial console connections
Thursday, February 9, 2012 at 6:37AM
Klaus Mueller in Apple Geekery, os x, tricks

One of the things I love about Mac OS X is having the UNIX-like command line available via Terminal. I tend to just use Terminal for ssh and console access to routers and switches and the like. I do however like to have my output automatically logged to a text file, so I created TextExpander snippets to pipe output to the "tee" command with automatically set a date-stampted filename.

For SSH the looks like:

 ssh user@11.22.33.44 | tee /Users/klaus/ssh_logs/%Y-%m-%d-%H%M%S-ssh.txt

For console via USB to serial this becomes:

 screen /dev/tty.KeySerial1 | tee /Users/klaus/ssh_logs/%Y-%m-%d-%H%M%S-console.txt

Works pretty well so far

Article originally appeared on architechnic.net (http://architechnic.net/).
See website for complete article licensing information.