Send stderr & stdout to same file

Categories General Info

Send standard error and standard out to the same file

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.