tee

, and,

Syntax

command | tee [options] file

Parameters

ParametersDescriptionExamplesLevel
-a Common
-i Common

Examples

make 2>&1 | tee build.log

sudo

echo 'new config' | sudo tee /etc/app.conf

cat data.csv | tee backup.csv | awk -F, '{print $1}'

apt install nginx 2>&1 | tee -a install.log

hosts (sudo )

echo '127.0.0.1 myapp.local' | sudo tee -a /etc/hosts

Tips

Related Commands