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.
|
|
|
# Display `ls` output to the user, but also write it to the given file.
|
|
|
|
ls | tee outfile.txt
|
|
|
|
# As above, but amend the data; previous file's data remains in-tact.
|
|
|
|
ls | tee -a outfile.txt
|
|
|
|
|
|
|
|
# Pipe the standard output of a given command into `tee`, which then displays
|
|
|
|
# it to the user and sending the data to files `one`, `two`, and `three`.
|
|
|
|
[COMMAND] | tee one two three
|
|
|
|
|
|
|
|
# Workaround to output data to a file, with root privileges.
|
|
|
|
echo 3 | sudo tee /proc/sys/vm/drop_caches
|
|
|
|
|
|
|
|
# Pipe the current Vim buffer to a shell process, which in this case is `tee`.
|
|
|
|
# This is especially useful as a shortcut added to `.vimrc` or similar.
|
|
|
|
:w !sudo tee %
|