This article may seem odd to those who have read a few of my others. However, this is by far my highest ranking search term. Thus I thought I would write up an simple and explicit explanation.

The following will send the output of ls -la /somewhere to something.txt. This includes standard output and standard error:

# ls -al /somewhere 2>&1 >something.txt

Leave a Reply

If Wordpress eats your comment (shell output, loops, ex..) brock (at) gmail dot com.