Skip to content

Latest commit

 

History

History

output_redirection

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

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