Questions tagged [tee]
The tee tag has no usage guidance.
46
questions
5
votes
1
answer
1k
views
How to print and pipe log file at the same time?
I use this to check the log lines of a log file until the occurrence of a specific event (taken from this answer to Monitoring a file until a string is found):
(tail -f -n 0 test.log &) | grep -q '...
0
votes
1
answer
64
views
How to make #tee take in -append instead of -a option (bionicpup32-8.0)
I'm trying to run team viewer on my bionicpup32-8.0
Running the command teamviewer returns:
Init...
tee: unrecognized option: append
BusyBox v1.30.1 (2019-04-24 21:49:26 +08) multi-call binary.
...
0
votes
0
answers
72
views
Write the list of content of a .rar or zip archive into a txt log file with 7z
I have a huge archive.rar and I would like to know its content without extracting it.
Using 7z on a Raspbian
Here are the commands i tried that did just write an empty output.txt file :
sudo 7z l ...
0
votes
1
answer
281
views
Bash split stream (tee) and join them together
I need to do something similar to this question, except that in that question the OP just concat the outputs of command2 and command3, and I need them be handed over separately, like this:
...
0
votes
1
answer
993
views
How to netcat to multiple ports
I'am using a raspberry and i need 2 local streams. This is what i've tried:
Attempt
raspivid <some options> -o - | tee nc localhost 5100 | nc localhost 5000
Question
I can receive the output on ...
2
votes
0
answers
258
views
ffmpeg tee mux option for restreaming a single input to multiple destinations without transcoding using Copy
Wanted to stream or "restream"" to multiple outputs using the tee mux but it appears that the copy flags don't seem to work.
Wanted to try something like this:
ffmpeg -re -i /home/video/test.mp4 -...
0
votes
1
answer
1k
views
Ffmpeg Tee muxer not displaying video stream
I'm trying to send an rtmp stream to wowza with the tee muxer. Then I'm reading the stream from wowza in HLS.
When running this command it works:
ffmpeg -re -i myVideo.mp4 -c copy -f flv
'rtmp://...
0
votes
1
answer
100
views
How to pass a pipe command to terminal -e?
I want to create a shortcut which shows in a new terminal the output of my command and simultaneously writes it into a log file.
I use terminal -e (or urxvt -e) to run the follwing command:
terminal -...
1
vote
1
answer
1k
views
How to suppress output from tee based on variable in Bash
So, in the following example:
echo "text to write to file but also not send to stdout" | tee -a $logfile 1> /dev/null
The output does not get printed on the terminal. But when I try doing the ...
1
vote
2
answers
242
views
tee command, show both stdout outputs
I would like to show the content of a file and also the calculated cksum of the file at once, why does the following command only output the file - but not the cksum?
sudo cat filename | tee cksum
I ...
2
votes
1
answer
6k
views
Pipe output of command line by line in Windows
I'm running a server from a batch file and I want the server output to be displayed both on the screen and also written to a log file. I found a way to do this from this answer:
powershell "...
2
votes
1
answer
1k
views
Pipe stderr to file and screen without redirecting stderr to stdout
In a bash script I'd like to execute a command while piping the stderr to both a file and to the terminal. However, I want stderr to stay on the '2' file descriptor so that I can parse it from an ...
105
votes
10
answers
30k
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
1
answer
324
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
1
answer
122
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
1
answer
88
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
1
answer
139
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 ...
2
votes
1
answer
776
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
1
answer
402
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 ...
7
votes
2
answers
6k
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'...
1
vote
1
answer
64
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 ...
3
votes
2
answers
2k
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 ...
4
votes
1
answer
4k
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....
8
votes
1
answer
5k
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
1
answer
11k
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
1
answer
2k
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
1
answer
300
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
2
answers
2k
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
1
answer
634
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
2
answers
4k
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
6
answers
11k
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:...
10
votes
2
answers
5k
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
1
answer
273
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
2
answers
2k
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
2
answers
982
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
2
answers
1k
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
1
answer
2k
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
1
answer
222
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 ...
58
votes
9
answers
37k
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 ...
9
votes
3
answers
18k
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
1
answer
9k
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 ...
123
votes
5
answers
56k
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
1
answer
536
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
1
answer
938
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 ...
12
votes
1
answer
10k
views
PowerShell and Tee
I use this command to see output both in the console and a file:
powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))"
powershell -command "my_command_2 ...
4
votes
1
answer
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?