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
also sends its input to STDOUT again, I never ever actually used that part of tee
for anything useful. In most situations, this feature only causes my screen to be filled with unwanted jitter, if I don't go the extra step and manually silence it with tee 1> /dev/null
.
My question: Is there is a command arround, which does exactly the same thing as tee
, but does by default not output anything to STDOUT?
tee
withcat >filename
, do you get the results that you want?cat
does not write to files by itself. And the>
operator doesn't work as the files are not writable by my current user. So no, that doesn't help a bit. And please stop to completely alter your comment's meaning every 2 seconds. Make a new one instead.>
operator uses the current shell user to write to the file. This user hasn't got the neccessary permissions.cat
is completely useless for that.tee
also sends its input to STDOUT again, I never ever actually used that part oftee
for anything useful: It's very useful for debugging complex pipelines. Just insert| tee /dev/tty |
at any point, to examinate the text going through that pipe. Example:echo foobar | sed s/oo/u/ | tee /dev/tty | sed s/r/z/ > /dev/null
, which will outputfubar
;)