You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
529 B
Plaintext

# To tee stdout to a file:
ls | tee outfile.txt
# To tee stdout and append to a file:
ls | tee -a outfile.txt
# tee would take the output of the first command in the pipeline and copy it
# to standard output (the terminal) while also making copies of it in the files one, two and three:
somecommand | tee one two three
# write 3 to /proc/sys/vm/drop_caches (with root rights)
echo 3 | sudo tee /proc/sys/vm/drop_caches
# in Vim:
# The structure :w !cmd means "write the current buffer piped through command".
:w !sudo tee %