ps �xyz >/tmp/proc 2>&1
Can anyone explain what does '2' and '&1' will do here?
Thanks to explain
ps �xyz >/tmp/proc 2>&1
Can anyone explain what does '2' and '&1' will do here?
Thanks to explain
File descriptor 2 is standard error, stderr. File descriptor 1 is standard output, stdout. This will make sure any output sent to stderr is redirected to stdout, which in turn was attached to the file /tmp/proc.
Bash manual on Redirections is a good read on the subject.