tee
, and,
Syntax
command | tee [options] file
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
-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
- sudo echo 'x' > /etc/file, sudo ; echo 'x' | sudo tee /etc/file
- tee : command | tee file1 file2
- : command | tee file > /dev/null
- tee