Questions tagged [tee]

For questions related to Linux syscall and a user program that duplicates the contents of a pipe. For security frameworks, use the tags [trusted-execution-environment] or [op-tee].

Introduction

The tee command reads from standard input and writes to standard output and files.

Examples of writing standard output include:

# print output of ps to a file
$ ps aux | tee ps_aux.txt

Using tee with sudo command

$ echo 'foo' >> file 
zsh: permission denied: file

As part of a pipe, tee can take the input and elevate permissions

$ echo "foo" | sudo tee -a file 

Links

How do I “tee” variable number of times in a bash “for loop”?

Linux and Unix tee command

536 questions
0
votes
0 answers

TFS plug-in for Eclipse ( Team Explorer Everywhere) in Ubuntu, does not reflect the changes made correctly

I have installed Team Explorer Everywhere (TFS plug-in for Eclipse) on an Eclipse Lunar on Ubuntu. I am connected to our company's TFS server at XYZ.visualstudio.com and I can successfully connect and browse the files. When I make changes to a…
0
votes
2 answers

Redirect output to mulitple files with tee and grep

I spent a lot of hours to get this to run: redirecting output from a script STDOUT + STDERR toLogfile 1 and a grep to Logfile 2 The First logfile should contain the complete output, and the second logfile only Start and End-Lines (grep). I tried…
Memphis01
  • 1
  • 3
0
votes
2 answers

store all the data in terminal to text file by tee command or equivalent tool

I learnt that a tee command will store the STDOUT to a file as well as outputs to terminal. But, here the problem is every time I have to give tee command, for every command I give. Is there any way or tool in linux, so that what ever I run in…
Rajasekhar
  • 894
  • 5
  • 13
  • 25
0
votes
4 answers

Write stdout to two different files (one overwrite, one append) in bash

I have a bunch of experiments that are organized by group and by number. I have 3 different groups and for number, I wish to run 2 different experiments. In other words, I have the following experiments to run: group A, 1 group A, 2 group B,…
synaptik
  • 8,971
  • 16
  • 71
  • 98
0
votes
2 answers

Pipe output to two different commands not interlaced

Using techniques mentioned here (Pipe output to two different commands) we can split a stdout into multiple processes. expensive_command | tee >(proc_1) >(proc_2) | proc_3 my problem is this interlaces the output. Is there a way to copy the stdout…
Jon
  • 1,785
  • 2
  • 19
  • 33
0
votes
2 answers

Counting and recording the number of arguments passed in a pipe

Is there any way of counting and recording the number of arguments passing through a pipe? I am piping a values from a file of unknown length. I can dump the number to STDOUT using tee but cannot get them into a variable: seq 10 | tee >(wc -l) |…
user3769065
  • 601
  • 6
  • 11
0
votes
1 answer

TFS mac eclipse plugin - Can't connect to server, error 403

I installed the Team Explorer Everywhere Eclipse (Kepler) Plugin but when I try to connect to the server i get this message: The SOAP endpoint https://vsas.myurl.com/Services/v1.0/Registration.asmx could not be contacted. HTTP status: 403 1st…
George
  • 371
  • 5
  • 16
0
votes
2 answers

stdout to multiple processes - Windows

Very similar to: How can I send the stdout of one process to multiple processes using (preferably unnamed) pipes in Unix (or Windows)? Particularly... proc2 -> stdout / proc1 \ proc3 -> stdout I have 'proc1' with…
Supervisor
  • 582
  • 1
  • 6
  • 20
0
votes
1 answer

Windows batch script output not written to log

We have this Windows batch script: call commands/do-work.cmd | tee my.log The do-work.cmd includes impdp user/pw@db directory=mydir dumpfile=my.dmp logfile=logdir:imp.log schemas=a,b,c,c parallel=6 ( echo my.sql echo exit ) | sqlplus…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
0
votes
1 answer

Redirect stdout to a file in tcl

I know this has been asked before. But hear me out once.. I'm working on a Cisco router (IOS). I have to write a script which executes some commands and redirect their output to a file. But instead of using tee for every command, I want to open a…
oak1208
  • 303
  • 7
  • 16
0
votes
1 answer

Piping in C: tee command produces empty file

I'm currently working on a programming assignment to implement the following in C: (rev | sort | uniq -c | tee outfile2 | wc) outfile1 I've taken a look at many posts regarding this particular assignment, which seems to have been…
0
votes
1 answer

Check My Understanding of cat and Posix Tee

cat < existingInputFile | tee newOutputFile > newOutputFile2 cat command is executed and the result is written in a file names existingInputFile then send the output of existingInputFile to tee after that I am lost... does tee get the…
Ria
  • 447
  • 6
  • 16
0
votes
1 answer

MySQL tee out.log works from client, but coming up blank when run in a script

When I run the following for the mysql> promt: USE database; TEE out.log; UPDATE...query... the result ends up in out.log as expected. However when running the following command from CLI: mysql -u user -pSECRET --tee out.log database <…
David
  • 68
  • 1
  • 7
0
votes
1 answer

Append Output results

I'm running a validation software and I want all of the output sent to a text file and have the results of multiple files placed/appended to the same file. I thought my code was working, but I just discovered I'm only getting the results from 1 file…
I Dabble
  • 321
  • 2
  • 11
0
votes
1 answer

type Command Shows 3 Identical Locations for File

In msysGit, when I run type -a tee(.exe), it shows me 3 lines with the same file: $ type -a tee.exe tee.exe is /bin/tee.exe tee.exe is /bin/tee.exe tee.exe is /bin/tee.exe tee.exe is /c/Program Files (x86)/Git/bin/tee.exe tee.exe is /c/Program Files…
trysis
  • 8,086
  • 17
  • 51
  • 80