← All commands
Topic hub PowerShell Equivalents
Windows Linux PowerShell Equivalents Expanded guide Text Processing

Windows PowerShell Tee-Object equivalent in Linux

Copies piped output both to the terminal and to one or more files.

Windows PowerShell Tee-Object
→
Linux equivalents
Debian/Ubuntu same command
command | tee output.txt
Fedora same command
command | tee output.txt
Arch same command
command | tee output.txt

Overview

What this command does

On Windows, "PowerShell Tee-Object" is used to display and save output. On Linux, the closest practical mapping shown here is "command | tee output.txt". Copies piped output both to the terminal and to one or more files. This reference is grouped under PowerShell Equivalents → Text Processing.

Migration tip: <code>tee -a</code> appends rather than replacing. It is also the standard way to write piped data through <code>sudo</code>.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows PowerShell Tee-Object maps to command | tee output.txt for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Practical tasks

Common use cases

Display and save output

Copies piped output both to the terminal and to one or more files.

ls -la | tee listing.txt

Display and save

date | tee -a history.txt

Append while displaying

printf "%s\n" "value" | sudo tee /etc/example.conf

Write a protected file

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

ls -la | tee listing.txt
date | tee -a history.txt
printf "%s\n" "value" | sudo tee /etc/example.conf

Walkthrough

Examples with explanations

ls -la | tee listing.txt # show and save output
date | tee -a history.txt # append and display
printf "%s\n" "value" | sudo tee /etc/example.conf # write through sudo

Reference

Common options and variations

Command or optionUse
ls -la | tee listing.txtDisplay and save
date | tee -a history.txtAppend while displaying
printf "%s\n" "value" | sudo tee /etc/example.confWrite a protected file

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "command | tee output.txt" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command command | tee output.txt Same command on this distribution.
Fedora same command command | tee output.txt Same command on this distribution.
Arch same command command | tee output.txt Same command on this distribution.

Keep learning

Related PowerShell Equivalents commands