Standard put to a file using the command T.
Now we have learned how to actually populate a file using the redirect commands like the greater than
sine you echo something, you are put to a file using the greater than sign.
Now, there's another way that you could do the same thing with using the command t what Teckman does.
T Command is used to store and view both at the same time the output of any command.
So in other words, the command is named after the tea splitter used in plumbing, so you've seen the
the tea splitter, right?
So you put in the water from one side.
It comes up from the both sides.
So this tea command works pretty much the same way.
So it basically breaks the output of a program so that it can be both displayed on the screen and saved
into a file.
It does both.
The task simultaneously copies the result into a specified files or variable and also displays the result.
So if you look at the picture, you'll see right here we have a command.
So whatever the command you run, you run, echo your own ls twd change of whatever the command that
you run.
Right.
You put a T in front of it and then it will not only send the output on the screen, but it would also
put it into a specified file, the file that you want the output to go to.
So that's how the T command works.
The reason we want the T command or the greater than sine command, which ought to do the same thing
is because if you wanted to run a command and you want output to a file, you also wanted to view while
you were running the command, you wanted to view how or what the output looks like and whatever that
goes into the file actually going the right output that you're looking for.
OK, so let me go into my Linux machine.
And I have it right here open, it's clear, the screen and type, who am I?
And you will see the name of the user account that I've been logged in with, which directory I'm in.
I am in my slash home slash.
I have sold directory.
Of course.
One more thing you should also check is the hostname that you logged in.
The hostname is the correct hostname, which is my first Linux VM.
These are the few things of course you need to check all the time to make sure that you are logged in
to the correct system.
Now let's get back to our command team now.
Let's say if he wanted to echo something on the screen, let's say we echo.
David.
Puddy is illanes.
Boyfriend.
They would put it is just a character in a in a show, Seinfeld, and he he was the boyfriend of Elaine
Bass.
So it's just that statement that I'm putting in.
And when you hit enter and you will see that same echo on the screen.
Now, we could use the greater than sign to output to a file.
So let's say if I want to output of Elaine Dash.
David, this is the name of the wall, right?
I could do that when I hit enter.
You'll see it has added this text.
To a file name, Elaine Dash David.
Now, what if I verified by running the command cat, Elaine David and you will see the file as.
The correct text that I wanted to have it in the file.
Perfect.
Now, if I replace it.
The same thing, let's clear the screen one more time and run the command one more time and you will
see when you run this command with uppercase sorry, not uppercase with redirect sign, it actually
runs it, but it doesn't throw anything on the screen.
But if you replace this.
With pipe and tea, then you will not only see the output going into Elaine Dash, David file, the
output will also show up on the screen.
So hit enter and you'll see.
David Puddy is Elaine's boyfriend.
So it is going both ways, as I said that.
Tea is like a Plummers tea that goes both ways.
So when you do cat Elaine David.
David Puddy is Elaine's boyfriend.
So now don't be confused at Haviva and that comment earlier, and it has that same text message that
we ran it with greater than sign, if that's what it's in your mind, that's fine.
Go ahead.
Remove Elaine.
David file so it doesn't exist.
Yes, so clear the screen.
Now we're on the same hit heading up our Rocky.
All right, Echo, David Puttees, Elaine's boyfriend, so anti Elaine Dasch, David, this is the file.
Hit enter.
OK, now, Dukat, David.
Sorry, Elaine Dashty, and you will see the full list here.
Perfect.
Now what if you want to add.
Our append.
To the same file, because if you type, let's say.
Echo.
David and Elaine into the same pile and hit enter and you look at Elaine, David, you'll see it removed
the the older file and created a new file with the newer output.
So you want to append it to a file that that older text message does not get deleted.
For that, you would have to use a command, same command, but with minus eight.
So hit up Arrow Key and go back to the same command that we ran earlier.
And this time type T dash a same thing.
Echo David Puddy is Elaine's boyfriend.
This is just a text pipe it and t it and with the option minus A and.
The problems in St. Paul and now go ahead and hit enter.
Now go ahead and do a cat on Elain David pile and you will see it has two lines.
First line is that we created a double minus minus a option and second line we created between minus
the option.
So that's how you append or add or create a new file.
Now, let's try to see how many characters do we have in Elaine and David file?
So the command is W, C minus C, and you will see it has 52 Elaine David characters.
We could also put that out that whatever that came on the screen to another file.
So I used this comen.
Which can be discussed or which I'll cover later on, of course, this command actually count every
word in the file called Elaine Dash David, and it will output on the screen.
You could actually redirect that output using a Teckman to enter the file as well.
Now, let's say if you wanted to do this myself and you see that listing, entire listing of your directory.
So let's say if you want to have all that.
Would the T meaning I want to just view it and at the same time want to put it to a file, so I'll put
it as name it list dyanne.
And hit enter and you will see the entire listing.
From here till bottom.
And you also see your far less dear.
If you do that last year and hit error and you will see the same listing, so let's clear the screen
and now hit up our key to cat listing our file again and you will see that Ellis' minus L output.
So basically it's putting on the screen and it is putting to a file.
If you wanted to do the same thing, that's echo minus L and you could also output to multiple files,
meaning this mysel t to let's say file one file to file three and enter.
You see it actually ran.
And it has all the listing of all three files as well.
And when I do cad file one.
It has the same content, careful to it has the same content and so on, the cat followed three same
Ellesmere's output.
So this is how the command works.
If you wanted to get more help or more options on the Teckman, you simply type T dash to help.
And you will see it will tell you exactly the options that are that is being offered by the help command
C minus A is to append in mind's eye is to ignore and version and help.
So if you type T.
Dash, Dash, Warren, to see the version of this command, you will also see that this command version
is a to two and it tells you this is a free software.
You are free to change and redistributed.
There is no warranty to extend the permitted by law and so and so on.
Written by Mike Parker, Richard M. Stallman and David McKenzie.
So these are the people who actually built this command.
Again, since Linux is an open source, you could even create your own command, write your own code
and introduce it to the Linux world.
So that's how the command works.
I hope you understand.
If you have any questions, you could just shoot me an email and try it out, try to with different
options.
Couple of options, and I'm sure it will work just fine.