Terminal commands there are some terminal commands that are used to help you manage your terminal more
efficiently.
Now number one command that I have listed here is a clear command so clear commandment you log into
your terminal your uncertain commands.
You could just simply type clear to clear your screen.
The next command we have is the exit command as it comment allows you to exit out of session a shell
session if you have gone into different shell terminals you exit out to come back to session.
Or you could exit the terminal that you have opened up or you could exit out of a user's session.
So if you have become a different user by switching it to ask you to a different user you could simply
type exit to come back to your own session.
Then the last one is the script script is very helpful command.
It's a command that stores terminal activities in a log file that can be named by a user.
You can run it and you can name it anything that you want.
When that name is not provided by the user then the default file name is used.
And that is type script the name of the file.
So let's try all these three commands one by one in our Linux machine
OK so when you run ls l t r who my bunch of other stuff myself here on the temp directory all that stuff
that comes up.
So you could hit enter enter and enter into to bring you to clear up your screen or simply type player.
This will clear your screen and many times when people run scripts.
The first thing they put it in their script is clear so the so the output will clear up everything on
your screen and then start from a new line.
Then you have the next command is exit exit and simply when you type exit it will exit out of your script.
If there is any script it was running before so I'm just going to clear that Monotype exit again one
more time.
And there you go.
It has exit out.
I had a few scripts commands that were running previously that's why I couldn't get it out earlier.
But anyway the last one got me out so I'll open up a terminal again and this time I'm typing exit again
to exit out of the terminal.
So this would explain better how the exit works.
If you become a different user let's say SU spider you put in the password.
Now you see you are logged in as Spider what if you want to go back into your original session which
is absolved.
You just type simply exit and you could come back again to yourself.
So this is what the exit command is mostly used for.
And the last command which I personally like because it records everything that you do on your session.
So what it does is when you run script you have to specify the name will put in transaction or log file
activity that law and I enter it this script started.
File is logged dash activity dot law.
And that log file is created in the same directory that you are in.
So when you on Ellis Mansel TR you'll see at the end it is.
It has created a file called log file activity.
I just ran this command LS Mynott LTE for this output of this command will be recorded in that.
So if I go into other directories let's say ETSI slash CD slash ETSI run LS minus LTE or clear my screen
type history command or type PWT and whatever data I am doing in my session everything is recorded in
my log file right now.
You will see if I do CD.
And if you go back to my home directory or PWT and I do as my cell to your you see the local activity
the size is keep increasing because it is keep recording all the commands and all the output that's
coming from those commands.
So now if I wanted to be done with the script command I'll just simply type access.
Once I do exit it will tell me script done file as log file the activity of law.
It means now it is not recording anything.
It has finished capturing the output of your session.
Now you could view as clear the screen or you can view that log activity which is right here when I
do more on the file I hit enter and you will see the first command.
When I ran after running the script command was the LS myself.
It recorded the command recorded the output of the command.
Keep going and then I went to seek a directory and I did Ellas myself.
He reported everything I did say all the commands everything that I did while I was running the commands
after the script the reason that I use the script command most of the time is because when I am troubleshooting
an issue or if I'm creating some some tools or creating some scripts this will record everything for
me.
So in case a month from now or a year from now and I want to perform the same tasks I don't have to
look up the commands to execute that on the terminal.
I could just simply go into my log file activity and I will view that and remember oh yes these are
the commands irène awesome.
It's like a log book or recording way.
It records all your commands in a log file.