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 command module, log
in to your terminal.
You run certain commands.
You could just simply type clear to clear your screen.
The next command we have is the exit command.
Exit command 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 your original session
or you exit the terminal that you have opened up.
Or you could exit out of what user's session.
So if you have become a different user by switching it to as 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 stores terminal
activities in a log file that can be named by a user.
You can run it and you can name anything that you want.
When that name is not provided by the user, then the default file name is used.
And that is TypeScript, 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 Ellis LTE tr who am I and a bunch of other stuff else myself here on the temp directory,
all the stuff that comes up so you could hit, enter, enter, enter into it to bring you to clear up
your screen or simply just type clear this will clear your screen.
And many times when people run scripts the first thing they put it in the 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 accident.
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 up.
I'm going to type exit again one more time and there you go.
It has exit out.
I had a few script 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 again
to exit out of the terminal.
So this will explain better how the exit works.
If you become a different user, let's say as you 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 I absolve 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 I will put in transaction or you
know what log file activity that log and I had.
And it says script started file as log dash activity log.
And that log file is created within the same directory that you enter when everyone else minus LTI,
you'll see at the end it is it has created a file called Log File Activity.
I just ran this command tr 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 at minus Alti are clear my
screen type history command or type W.D. and whatever that I am doing in my session.
Everything is recorded in my log file right now.
You'll see if I do.
And if you go back to my home directory type W.D. and I do this myself, tiar you see the lawful 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 exit once had to exit.
It will tell me script done file is log file dash activity the log.
It means now it is not recording anything.
It has finished capturing the output of your session.
Now you CAVU has cleared the screen.
Now you can view that log activity which is right here and I do more on the file.
I hit enter and you will see the first come in.
When I ran after running the script command was the mysel tr it recorded the command, recorded the
output of the command, keep going.
And then I went to ETSI directory and I did this myself.
TR recorded everything I did see 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 am 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 wanted 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 yeah, these are the commands I ran.
Awesome.
It's like a logbook I recording.
Wait, it records all your commands in a log file.