3.10 Linux System Part 2

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
5 hours 21 minutes
Difficulty
Beginner
CEU/CPE
6
Video Transcription
00:00
Hello and welcome to command line basics. In this video, we're gonna go over Lennox system commands to I'm Christopher Hyler, and let's begin.
00:08
So are lending ejected from this video? We're gonna learn the idee command, understand the last command when the p s command and learn the kill command as well. They're all very useful system commands in orderto, you know, manage and manipulate your system into what you needed to do.
00:25
Pre assessment that P s command lists all running processes by default. Is that true or false?
00:33
The answer is false. It will only list the running processes for your user account by default. In order to list everything that is running on the machine, you're gonna need to use the A U X switch as well. And we learned that this video
00:48
all right, So I d c I. D. Command disused, for it is used to print user and group information, and it can also show up permissions for other users as well. So this is a useful command in order to quickly understand the permissions for a user. See, look rich, they're part of and all that. So
01:06
if we jump over to my linens machine.
01:08
I can do I d user because this is my easier account name, and I'll show all the groups that I'm a part of this one. So this is my user I d here 1000
01:19
the group I d and a whole much different groups that I'm a part of
01:23
so important to understand, and we can use it for other accounts as well. So let's say I d route
01:32
you can see you it zero That is always the route you would.
01:36
And then it's in the root group hand. He a group ideas well, so very useful to find information about a user account.
01:45
Now the last command, What this command does is it shows the user's that last long into the system. And also she was exactly what, exactly they usedto long into the system. If it was remotely over as, say, Jer, if it was with the keyboard and also show when the system booted as well.
02:01
So this is useful in order to kind of keep tabs on exactly how users are authenticating to the computer.
02:07
So over here, I'm gonna get back to my limit show. I'm going to type last
02:14
and check it out. You can see that I have longed into the machine a few times and reviewed it a few times. 12.
02:20
So the last time I logged in was Saturday, September 14th at 14. 47 it is still running.
02:27
I have not logged out yet. And this reboot I did at 14. 47 as well.
02:32
So this is useful in order to keep track of user accounts and have their logging in.
02:39
So the P s command, this is what we're learning about in the pre assessment where it'll display running processes on the system
02:46
so it only displays the current user processes by default as well. And if you won't be able to see all the processes on the system and P s a u X now, these switches the a u X, which is do not have that dash in front of it. So keep that in mind,
03:06
right? So let's take a look. Take PS and you can see I'm running bash. And then the PS command as well does it. P s is a program that is running through bash so we can see the process idea where the pid for these commands as they run as well.
03:21
And now let's say I want to see everything on the machine. I'm gonna take P S, u X,
03:28
and this shows everything running on the machine and the commands that reused to submit them to start them as well.
03:37
So this is useful in order to see exactly what's going on with your Lennox machine at one time.
03:45
All right, we have the kill command with kill commandos is it ends a running process. And the best way to do this is to use the pit of a process night. Wait. You know exactly which one is going to be ended
03:58
so this could be used to either, you know, help end a process that is frozen, a process that you did not mean to start or you know something that another user left running up when they were loved. And it's eating up. System resource is
04:12
so it's important to be ableto feel comfortable with the kill command and use it to end processes as you need it too.
04:19
So let's go back over, and I'm going to start a new process, gonna start Terminator,
04:28
and as you could see this? The Terminator program we installed in a previous idea and when this starts up has 27 88. This is the pit for this new program that we just started
04:39
and that you're not aware already having the single and percent after a command in a clinic, Shel, it sets it up in the background. That way we'd still have control of our show, and we'll learn this in a later video, So don't be worried about it.
04:53
Now stay PS again. And as you can see, we have the Terminator program running the paid 27 88
05:00
and we still have this window up so you can see the window in the background a little bit. Now it's type kill
05:09
and 27 88.
05:12
And as you can see, that window is going to the background.
05:15
And if we tie PS again, that program is terminated. So it's a very useful wait in order Thio end a process that you may not want started. We're still learning,
05:27
and it's important to keep in mind, too, that we can end other user processes if we're using the route account because the root is in charge. of the entire system so we can use it and kill any other pit running for any other users.
05:40
All right, post assessment. The kill command can be used to end other, easier process. Is is this true or false?
05:46
The answer is true. I hope you got this one right, because I just said it. So using the route account we can end process is running on under other user accounts. This is a very useful way in order to be able to make sure that
06:00
we can keep control of our system or end any hang processes or processes that air using a way too many resource is
06:09
aren't so. In this video we learned the idea Command understood the last command during the PS command and learned the kill command. And I hope to see you in the next video.
Up Next