Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tee]

The tag has no usage guidance.

84
votes
10answers
19k views

What is the purpose of 'tee'?

All the usages of tee I ever saw were such: do_something | tee -a logfile Or: do_something_else | tee logfile Is tee invented for those that don't know you can do the same with shell pipe ...
1
vote
1answer
68 views

Using “tee” to selectively log Ubuntu terminal output?

I need to log terminal output. But I only need some outputs which starts with a keyword (say starts with "error"). I use something similar to: ls | tee "log.txt" In this example command I do not ...
0
votes
1answer
20 views

Copying console output of dd to file as well as to console

I'm trying to image a hard drive using dd which is giving I/O errors. As a result I added the 'noerror' parameter, but I'd like to keep track of the errors in order to attempt recovery. My current ...
1
vote
1answer
29 views

Only last tee writes to file (possible overlap with exec?)

I try to have all my outputs redirected to a.out, except some that must also be written to b.out. I think using exec on top of tee (tee to also redirect to b.out) would be fine but tee does not look ...
0
votes
1answer
45 views

Tee causes format problems at console when running lxc-attach commands in session

I use tee to capture output of an install script to a file in the usual way. All is fine except when there lxc-attach commands executing in an LXC Linux container. For example (see attached ...
3
votes
1answer
258 views

Piping with Process substitution and joining output again

I'm trying to make use of a powerful remote server in terms of video encoding. I have a local DVD drive for ripping DVD to memory, finally residing in an mbuffer. From there, I would like to split ...
0
votes
1answer
65 views

Tee alternative (user input missed)

we are using some 3rd party interactive command line tool, and we use tee for logging what a user did - to check later if needed... The tool works the way it ask which action user want to perform and ...
4
votes
1answer
735 views

Can you prefix each line written with tee with the current date and time?

I am using the 'tee' command in order to capture the results of a long bash command to a file. Can the file I emit with tee somehow prefix each line with the timestamp of when the line was written? I'...
0
votes
0answers
294 views

FFmpeg tee muxer processing audio differently

I'm struggling to get the tee muxer to work. When I output to a local file directly it works, but when I replace the output with a tee it fails, so:- ffmpeg -loglevel trace -f mpegts -i udp://192....
1
vote
1answer
53 views

Using tee, I lose my sudo privileges

I am writing an installer script and need to run it a sudo as I test it on AWS RedHat instances, so can't directly go as root. I want to write the log into a file as well as onto the screen. Nothing ...
2
votes
2answers
375 views

Let Tee Handle Carriage-Returns Better

I've written a Java-console application that repeatedly prints its status to the console using carriage-returns (\r) at the end rather than line-feeds (\n) to keep the output on one screen. I also ...
3
votes
1answer
1k views

Can I calculate the checksum of a file as I create it?

I am creating a large tar archive and I would like to create the checksum of the archive too. I could achieve it like this: $ tar cfz archive.tar.gz files $ sha256sum archive.tar.gz > archive.tar....
2
votes
1answer
1k views

Tee a script to file within itself

I'm familiar with using tee, and I know that I can simply log output with script.sh | tee file.log However, I want a seamless interface for the user. Is there a way to, within script.sh, run tee as ...
0
votes
1answer
4k views

How to install libelfg0-dev on ubuntu 16.04 LTS 64bit version

I am trying to setup Open-TEE environment by following the instruction from https://open-tee.github.io/documentation/ The Open-TEE requires installing libelfg0-dev. But when I run sudo apt-get ...
0
votes
1answer
757 views

FFmpeg command line with option tee muxer, output to video file, and image2 muxer at the same time

I would like to save still images from a video, which is on a direct http URL. At the same time I want to save the video as well. How can I use ffmpeg with its special tee muxer to save the images and ...
0
votes
1answer
118 views

How to store data from different netcat connections in separate files?

I need a server that should receive data streams, store them in files and send further. Each connection should create a file with corresponding timestamp in file name, then write to it. My solution: ...
1
vote
2answers
581 views

How to redirect stderr of python3 script using tee pipe?

I am a Debian and RedHat user. I would like to redirect stderr (module logging) from a Python3 script. The script outputs a lot of things and the part I want to capture can be fetched using: python3 ....
0
votes
1answer
428 views

extracting multiple .gz files, and printing the name of the extracted file

I would think this is easy but I'm blocking… I have a directory with a series of log files (from minecraft server…): 2014-09-28-1.log.gz 2014-09-29-1.log.gz 2014-09-30-1.log.gz 2014-10-01-1.log.gz ...
2
votes
2answers
2k views

tee causing bash scripts to hang

I have a script that calls a number of other install scripts ./script1.sh 2>&1 | tee script1.log<br> ./script2.sh 2>&1 | tee script2.log<br> ./script3.sh 2>&1 | tee ...
4
votes
6answers
5k views

How can I both pipe and display output in Windows' command line?

I have a process I need to run within a batch file. This process produces some output. I need to both display this output to the screen and send (pipe) it to another program. The bash method uses tee:...
5
votes
2answers
2k views

tee: What exactly does “--ignore-interrupts” option do?

The title basically says it all. tee has an option --ignore-interrupts: -i, --ignore-interrupts ignore interrupt signals Can anyone explain/give an example in which situation this is important? ...
-1
votes
1answer
89 views

Why the tee command output something very strange when I capture the result from VIM?

I can recognise the welcome message, like: VIM - Vi IMproved[9;35Hversion 7.3[10;29Hby Bram Moolenaar et al.[11;19HVim is open source and freely distributable[13;26HBecome a registered Vim user![14;...
0
votes
2answers
925 views

UEFI vs. ARM TrustZone

I understand UEFI has a Secure Boot feature that is now for all Win 8 (tablets, and smartphones). How does this fit in with AMR's TrustZone for example? Is UEFI like a firmware TPM that can sit as a ...
1
vote
2answers
581 views

How to log output of a part of a shell script

I'm looking for a concise solution for logging the output of a part of a shell script to a file. Additionally, I still want to be able to follow the life output on screen. From the man pages of "bash"...
1
vote
2answers
291 views

linux pipeline/tee process sequence

I think for the linux command, the pipeline: $ command1 | command2 | command3 will execute with sequence command1 -> command2 -> command3. But what about using tee: $ command1 | tee >(command2) >(...
1
vote
1answer
1k views

How to combine the tee command with interactive scripts to log the results?

From some time usually record long outputs with tee to later less them, this is awesome to review configure and make outputs and such, but fails when the script or program is installation like, asking ...
0
votes
1answer
208 views

update terminal title from standard output of long running command?

I'd like to change the title of a terminal window during a long running command (for example: git svn fetch) with values greped from the output, whilst still writing to standard output. Is this ...
28
votes
6answers
13k views

Alternative to the tee command without STDOUT

I'm using | sudo tee FILENAME to be able to write or append to a file for which superuser permissions are required quite often. Although I understand why it is helpful in some situation, that tee ...
4
votes
3answers
7k views

Use netcat as a proxy to log traffic

I want to use netcat as a proxy to log http requests and responses to files, then tail these to inspect traffic. Think wireshark. Tried the following where 'fifo' is a named pipe, 'in' and 'out' are ...
1
vote
1answer
5k views

Using tee to pipe ls and grep output into tail command without a script

I have an issue running through log files. I'm looking to use ls to create a list of files in the log directory and grep to run through for the specific instances/times the file ran. I only want to ...
34
votes
2answers
14k views

Preserve colors while piping to tee

ls -l --color=auto | tee output.log Without pipe/tee it's colored. How can I make it so that it stays colored while using tee (can be colored only on the screen, I don't care about colors in logs).
2
votes
1answer
464 views

cygwin mirrors/ repositories - tee and svn

I have run Cygwin setup using a handful of different repositories, but certain programs appear to be missing from from the ones I have tried so far. I am specifically looking for tee and svn. Which ...
3
votes
1answer
830 views

Linux: redirecting stdout and stderr

I want to write stdout to a file but also prints stdout and stderr. I tried using tee: prog | tee stdout.txt but this causes the printed stderr and stdout to be interleaved incorrectly, i.e. if the ...
8
votes
1answer
4k views

PowerShell Tee questions

I use this command to see output both on console and file: powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))" powershell -command "my_command_2 | tee ...
4
votes
1answer
1k views

How to tee to stderr? (multiple sinks in one pipeline)

some_source | (tee /dev/stderr | sink_1) 2>&1 | sink_2 Seems to fail. How to do it right without of any temporaries?