Stack Exchange Network

Stack Exchange network consists of 175 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]

`tee` is a command that reads from standard input and writes to standard output and to a file, so that the user can see output from a command at the same time as saving it.

1
vote
1answer
94 views

use tee to save log file in a subfolder (defined in a variable)

The input file of a script is passed as an argument from command line. I want the log file from tee to be saved in the same directory than the input file: Lets say that input file is at "data/temp/...
1
vote
0answers
31 views

Can I use tee for large logoutputs on a server 7/24?

The tee command https://unix.stackexchange.com/questions/35935/how-to-log-to-file-and-to-console writes the console output as well to a file. However when I open the file while the main program is ...
0
votes
1answer
412 views

use “tee” command to append asterisk debug information to file

When I run: $ asterisk -rvvv | tee temp-log-asterisk.txt $ ubuntu*CLI> dialplan reload $ exit this is the real output of asterisk: Now when I look into the content of temp-log-asterisk.txt I ...
0
votes
2answers
116 views

Directing not empty output into a file

I want to save only non-empty output of find command into a file. If there is no output file should not be created. $ ls folder aa $ find . -name 'bb' | tee file $ cat file $ ls folder aa file How ...
0
votes
0answers
676 views

The right way to configure USB power in ubuntu

echo on | sudo tee /sys/bus/usb/devices/*/power/level > /dev/null The command above is used to keep USB power on (Turns off USB power-saving). I execute the command every time I log in to Ubuntu ...
1
vote
0answers
28 views

how to print for multiple files differently? [duplicate]

Give a single command line for searching a file ‘datafile’ for the string “Internet”, sending the output of the command to a file called ‘Internet.freq’ and any error message to a file ‘error.log’. ...
0
votes
1answer
142 views

Cannot duplicate all ouput to a file with tar/pigz [duplicate]

I'm using in my script: tar cfh - "$SRC_DIR" --exclude-from <(find $SRC_DIR -size +$EXCLUDE_MB_FILES) | pigz -9 --quiet --keep --recursive --rsyncable > $BACKUP_TARGER_DIR/$ARC_NAME | tee $...
2
votes
1answer
381 views

Why is the tee command necessary?

On Ubuntu my Brightness keys don't work. So instead to open Ubuntu settings every time, I want to write a shell script to use in my .bashrc. Now I don't understand at all why the tee command in the ...
0
votes
2answers
88 views

Editing a text file does not save changes

I am trying to follow instructions from here to enable backlight for my keyboard on Dell Vostro 3350. I want to change the contents of a /sys/class/leds/dell::kbd_backlight/brightness file, which ...
54
votes
1answer
61k views

How to append tee to a file in Bash?

These are commands I type in the terminal echo -e "First Line" | tee ~/output.log echo -e "Second Line" | tee ~/output.log When I look in the file output.log I only see 'Second Line'. How can I make ...
1
vote
3answers
4k views

Debugging preseed/late_command for ubuntu 16.04 server: tee not found vs nonexistent directory

I am trying to run the following preseed file on a ubuntu 16.04 server machine (during a packer build): d-i preseed/late_command string \ in-target mkdir -v -p -m 0440 "/etc/sudoers.d"; \ in-target ...
0
votes
1answer
32 views

Running tee from alt+f2

For some reason this works from term and does not from "run" dialogue or Openbox shortcuts... echo 200 | sudo tee /sys/class/backlight/intel_backlight/brightness
8
votes
2answers
6k views

lint: command not found

Does Ubuntu have a lint utility? How is it installed? In computer programming, lint is a Unix utility.. https://en.wikipedia.org/wiki/Lint_%28software%29 thufir@mordor:~$ thufir@mordor:~$ gcc ...
9
votes
4answers
3k views

Reading and writing a file: tee command

It is well known that a command like this: cat filename | some_sed_command >filename erases file filename, as the output redirection, being executed before the command, causes filename to be ...
2
votes
2answers
1k views

'sudo tee' command gone wrong | Removing a source.list that can't be read?

This has happened twice where I followed instructions on installing software and then having the software center open then close immediately as a result of running the commands from the instructions. ...
3
votes
2answers
114 views

tee results in a null file

I try to change Apache configuration with this: sudo awk '/<Directory \/var\/www\/>/,/AllowOverride None/{sub("None", "All",$0)}{print}' /etc/apache2/apache2.conf | sudo tee /etc/apache2/...
10
votes
2answers
8k views

Tee doesn't get whole output from the pipe

I have a script executing commands like: export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH;./some_app -i $INDEX | tee $LOG echo "Number of errors: $(grep "ERROR" $LOG | wc -l)" The problem is probably in ...
0
votes
1answer
484 views

GPS nmea output, saving only last record to external file linux

I'm using a globalsat G-STAR IV GPS for my Vehicular Ad Hoc networks project. In this, the nmea output coming from the GPS gets updated every 1 second. I want to know if there is a way to save just ...
1
vote
3answers
8k views

How to Automatically save terminal command output to file [duplicate]

Is there a way that I can save the terminal command output to a file, without having to write the command ' | tee /abc.txt' every-time around?
37
votes
3answers
21k views

Is there any significance to using tee?

Why is it that almost all instructions regarding appending text to system files like fstab and /etc/apt/sources.list.d/<name>.list involve using tee and echo to append said text? Take the ...
1
vote
1answer
1k views

Capturing text output to a log, while printing REALTIME to terminal

My output prints approximately 1 line per second to the terminal, maybe 100-200 lines in total. I've tried to capture the output using tee, but it prints all the lines at the end of the process, not ...
1
vote
1answer
4k views

how to redirect output to a log file without tee? normal redirection is not working

why not use tee? because the terminal rendering of the output makes the application run slower. for some reason, this is not working: application 2>&1 >"$logFile" the output keeps going ...