Thursday, July 14, 2011

Saving the input to `less' command

less is good for viewing long outputs from other programs.  There may be times when you pipe the output of a program to less and realise only later that you want the output in a file... maybe because you need to send the output to someone via email.

You can quit less and change the command line to output to a file.  But there are better/faster options.  less supports an s command to save its input to a file.  Just press s, enter a file path to save the text to, and you're done.

No comments:

Post a Comment