System Management

A deployment script, ./deploy.sh, writes progress messages to standard output and problems to standard error. An administrator wants to filter both streams through grep for the word "failed". Which TWO commands do this? (Choose two.)

Choose 2 answers

Show the answer

Correct answersA. ./deploy.sh 2>&1 | grep failedD. ./deploy.sh |& grep failed

Both 2>&1 before the pipe and the Bash shorthand |& merge stderr into stdout, so grep receives both streams. A plain pipe passes only stdout, so error messages bypass grep and go to the terminal.