Kolam Ayer MakersLinux Foundations

stderr Redirect (2>)

Use

find /etc -name '*.conf' 2>~/playground/errors.txt

What It Does

2> sends stderr to a file.

Practice

Use it when permission errors are useful evidence but should not mix with normal output.

find /etc -name '*.conf' >~/playground/conf.txt 2>~/playground/errors.txt

Watch Out

> redirects stdout. 2> redirects stderr. They are different streams.

Docs Pointers