-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SC2069
koalaman edited this page Nov 20, 2014
·
8 revisions
firefox 2>&1 > /dev/null
firefox > /dev/null 2>&1
Redirections are handled in order.
The problematic code means "Point stderr to where stdout is currently pointing (the terminal). Then point stdout to /dev/null".
The correct code means "Point stdout to /dev/null. Then point stderr to where stdout is currently pointing (/dev/null)".
In other words, the problematic code hides stdout and shows stderr. The correct code hides both stderr and stdout, which is usually the intention.
If you want stderr as stdout and stdout to a file, you can ignore this message.