nodebase
nodebase

Reputation: 2713

On a Linux system, how would I redirect stdout to stderr?

I think its the case that you can't just assign the stdout to stderr because other things might have already cached (?) stdout by the time the reassignment takes place.

So how do I do this (using Linux)?

Upvotes: 39

Views: 22003

Answers (1)

Am_I_Helpful
Am_I_Helpful

Reputation: 19158

To redirect the stdout to stderr, use your command as follows :-

$ command-name 1>&2

where command-name is the command you're going to feed, 1 represents stdout and 2 represents stderr .

Upvotes: 58

Related Questions