🖥️tee
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the tee command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗███████╗███████╗
# ╚══██╔══╝██╔════╝██╔════╝
# ██║ █████╗ █████╗
# ██║ ██╔══╝ ██╔══╝
# ██║ ███████╗███████╗
# ╚═╝ ╚══════╝╚══════╝
tee
T
The tee command is named after plumbing terminology for a T-shaped pipe splitter. This Unix command splits the output of another command, sending it to a file and to the terminal.
# 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 %
#==============================##==============================#
# CMD TEE #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command tee in a clear format. This allows users to quickly access the needed information for tee without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for tee are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.