tee command doubt
5 posters
tee command doubt
How to use tee such that the list of the logged users as well as their count is displayed only on the terminal and the same is not stored in any file.
preethika subramanian- Posts : 6
Points : 12
Join date : 2010-02-26
reply
who |tee <0; who |wc -l
this ll work.....
this ll work.....
anand- Posts : 55
Points : 70
Join date : 2010-02-26
Age : 36
Re: tee command doubt
"tee" command sends the output to standard output and also to a file.
eg
Output of ls command will be printed in the screen and also stored in sample.txt file.
eg
- Code:
$ ls | tee -a -i sample.txt
Output of ls command will be printed in the screen and also stored in sample.txt file.
Re: tee command doubt
<0 is not required in above command.
This can also be used
who -q | tee
This command will save the result in some temporary file and also display the result.
This can also be used
who -q | tee
This command will save the result in some temporary file and also display the result.
urvershi- Posts : 21
Points : 70
Join date : 2010-02-26
Re: tee command doubt
i got it. It is called quick who. Only displays logged in usernames and their count...
Re: tee command doubt
-q is used for displaying only logged users name and total no. of users logged on.
urvershi- Posts : 21
Points : 70
Join date : 2010-02-26
Re: tee command doubt
even "who -q" produces the same output. then wat is the significance of using "tee" command there.
Re: tee command doubt
since the question needs it...............maybe
anand- Posts : 55
Points : 70
Join date : 2010-02-26
Age : 36
Re: tee command doubt
Main purpose of tee command is to split the output and write it to both a file and stdout
The solution that i think is,
just write the command without 'tee' which serves the purpose
and append ' | tee ' to it. simple
Here are some of the ways to do it,
( who ; who | wc -l ) | tee
(who | tee ) ; (who | wc -l) | tee
However the outlet to file in ' T ' should be made dummy...
The solution that i think is,
just write the command without 'tee' which serves the purpose
and append ' | tee ' to it. simple
Here are some of the ways to do it,
( who ; who | wc -l ) | tee
(who | tee ) ; (who | wc -l) | tee
However the outlet to file in ' T ' should be made dummy...
Mahee- Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia
Permissions in this forum:
You cannot reply to topics in this forum
|
|