• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

tee: command not found

by admin

The tee command reads the standard input, sends the output to the default output device (the CLI), and also copies the output to each specified file. This command enables you to verify the output of a command immediately as well as store that output in a file for later reference. Like xargs, tee typically accepts input from another command using the pipe operator.

When used with the -a option, tee appends the output to each output file instead of overwriting it.

Syntax

The general syntax of the tee command is:

# command [options] [arguments] | tee [options] {file names}

Let’s say you want to check the contents of a directory and also output those contents to a file to process later. You could issue separate commands to do this, or you can use the tee command like so:

# ls -l | tee listing.txt

If you encunter below error while running the tee command:

tee: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
OS X brew install coreutils
Debian apt-get install coreutils
Ubuntu apt-get install coreutils
Alpine apk add coreutils
Arch Linux pacman -S coreutils
Kali Linux apt-get install coreutils
CentOS yum install coreutils
Fedora dnf install coreutils
Raspbian apt-get install coreutils

tee Command Examples

1. Copy standard input to each file, and also to standard output:

# echo "example" | tee path/to/file

2. Append to the given files, do not overwrite:

# echo "example" | tee -a path/to/file

3. Print standard input to the terminal, and also pipe it into another program for further processing:

# echo "example" | tee /dev/tty | xargs printf "[%s]"

4. Create a directory called “example”, count the number of characters in “example” and write “example” to the terminal:

# echo "example" | tee >(xargs mkdir) >(wc -c)

Filed Under: Linux

Some more articles you might also be interested in …

  1. apt-file: command not found
  2. “mamba repoquery” Command Examples
  3. How To Check World Wide Port Names (WWPN) of Tape Drives Attached to Linux host
  4. kdig Command Examples
  5. “git verify-tag” Command Examples
  6. conky: command not found
  7. ansible-inventory – Display or dump an Ansible inventory (Command Examples)
  8. ss: command not found
  9. doxygen: A documentation system for various programming languages
  10. cmark: Converts CommonMark Markdown formatted text to other formats

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright