Send output of last command to a file automatically in bash?

Viewed 791

Using bash on OSX. How can I set up my shell so that it overwrites a certain file with the output of my most recent command? This would be really convenient for viewing/searching/analyzing large outputs that I didn't have the foresight to pipe to a file. Thanks for the help!

3 Answers
Related