Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 489 Bytes

File metadata and controls

25 lines (15 loc) · 489 Bytes

bash: improve your command line & script productivity

output redirection

file descriptor number
stdin 0
stdout 1
stderr 2
./script.sh 2> err.log > out.log

./script.sh &> outAndErr.log

./script.sh |& tee outAndErr.log # and still shown on the console

./script.sh 2> /dev/null | grep outPattern # stderr is suppressed

./script.sh |& grep outAndErrPattern