Welcome to Cyber very 18. I'm great, Stuart. I'm your subject matter expert for Lennox. Plus
part four of module to the installation and configuration module,
I'll be covering the command line interface
earlier parts. We talked a little bit about the command line interface and even saw some examples of how to use. It's very simple example some simple commands
to help you understand how to navigate the file system a little bit easier.
So we know that you can also use the graphical interface user interface to navigate the file system.
I prefer to do it through the through the command line. So I'm gonna go ahead and launch the terminal here, which is pinned on my my took my taskbar.
Launch it. It brings me up. Let me blow this up for you
when I launch it brings up the the terminal window,
And when I am, why I'm automatically dropped in is my working directory is tthe e home directory for my user Cyberia Admin.
So you can see here The prompt is Sai Berry admin, which is my user name
at Cyberia Lennox BM and what that is That's the name of my virtual machines. This is who's using it and on one machine. And again, if I do a p w d
sorry, she shows them in my slash home slash library admin working directory. So that's my home directory.
if I want to change directories again The Commander's CD so much changed just to show you a CD to the root directory. There I am.
And again remember, you have to be extra careful when you're working with the root directory is here at the very root of the file system.
Anything you do here could have a recursive reaction on the entire file system. Shut everything down.
So just let me show you a um let me give you a quick example of that. So I had a good friend that teaches a different class. It's certified problem master class,
and he once told me of, ah, situation where he was using Lennox for General Motors.
Well, he's an employee at General Motors. He actually
ransom of living systems and what he did One day it was he was trying to delete a directory that he had created by accident
and need it renamed, so he didn't realize he was at the root level of the actual entire file system. He's where we were, where we are right now, just to show you it's a
It's just the slash There is room. What he did was an R E m Dash are
RN Dash are in any other situation. We remove recursive lee, remove
anything that's in that working directory.
So you either type in our M and then the file name or the director named that you want to delete that exist within the working directory you're on currently.
And it would delete that. However, if you want to delete every file system in the working underneath, the working directory that you're in, you're type of dash are it's recursive. That means it's going to delete everything.
So when he did that, he was at the root level. So he did that pressed enter and then he said it was like
something out of a movie. He watching. All of a sudden, all the lights and the General Motors factory started shutting down
and just kind of going off going off, going off. All the machine stopped, everything stopped and General Motors was down for about four hours,
and what they ended up finding out is that when he realized what he did, they came to him. He said, you know, packed my stuff. It's okay.
And the guy said, No, you gotta You gotta fix that. You're the guy that did this. You gotta fix it. And what? What they said was that you shouldn't have had root level access like this and actually fired his boss in his boss's boss for not putting the user permissions in the right place. User access control or say
so. You know, he went on fixing it, got it all back online, but it ended up costing General Motors about a $1,000,000 a minute. That's how long being down for that long. How many hours did for them?
So it's It could be a very dangerous place to be if to make sure that you're doing what you should, and especially if you're just working at the root level with a root account,
that's that's That's the most powerful account on the box. You can pretty much destroy the entire file system. So just a word of caution to be aware of what you're doing when you're working with it. And what Working director? You're actually in here in here, using commands and deleting things and copying files, etcetera. So just a word of caution.
So now I'm here. There's a couple of things I can do right off the bat.
So, just like in Windows, when you need to do something that requires administrator privileges If you're doing it from a command line, you're gonna run in command
using command line and I'm a Windows machine. You have to right click it or a shift right click and select runners administrator.
What that does is it drops you into administrative motor administrative account on the machine, which allows you to do a lot more.
Let's see you do a lot more processes that require administrative permissions. Then you would normally do with your regular user town.
Well, the same applies with Lennox Box, however, with blanks. There's a couple of different things you can do so with with a bun, too. It's slightly different from the other Destro's slightly different from red hat. Where's in Red hat? You would simply typed S U B s you command, which is switched user,
and then the command and Then there were the count that you want. So s you root.
So that drops me here and I would type in my password.
However, in a bun to what you can see here is that it's telling me authentication failure because the route user in a bun too is completely 100% locked down.
So when you don't want to unlock it, why don't you want to unlock it? Because there's a different commanding and use that basically does the same thing that keeps you from constantly being
in the root account, which is a good safety feature.
So on red hat, if you do this and you type s you route it, give you the password you lie would let you log in, or Fedor are Santos will let you log in, and then you'd be the route user and you be, you know, you could do any command and there'll be no stopping you. Spare the dangerous to use
with Sue Commander pseudo. Everybody pronounces a little bit different. I say suit pseudo
uh, Sue, do what it does. Is it saying
switch user and do as route would do
for this command gain and so It's a one time command. Want one for one.
So what I want to do?
Oh, let's say I want to download the G parted program. And to do that, I would type after get
departed. And this is the partition editor that we talked about. An early one. I'm gonna install it. Click that, and it couldn't is Just
see what they see with the air. Says here could not open long file. Okay.
Permission denied. Unable to lock the administrative directory Are you root and ask you a question or using route will shoot. Obviously, I'm not. I'm not using it.
So I need to show them that I have the privileges to do that. So I'm gonna go ahead and do that. And the way I do, there's I put a suit do in front of the app, get
basically the same command, hit the up. Ever give me the same command.
Well, I'm gonna go back in front of that command. I'm gonna type the studio sugo space.
Well, that's gonna do when I want to hit Enter. That's gonna give me a prompt for my past. Verceles, try.
Okay, now it's saying, What's the soup password for Cyber? We had him.
So it's basically gonna be my password the way I have a computer. It's just the same password. Know some people have administrator accounts and windows and regular accounts
for the purpose of this class. I just keep it all the same just to keep things easy.
So I'm gonna go ahead and typed. Password was just my regular
one and right right away kicked off the installation of G parted. So it's asking me what I want to do. So it goes through and it's telling me, dependency list done. It checks. Everything is gonna be installed here.
Here's the suggested packages, et cetera.
and it says after this operation very last thing. 6169 kilobytes of additional data disk space will be used to You want to continue? You just type? Yes.
And it will go ahead and it's gonna download and unzip the package.
Fergie part is going to stall it. Okay.
How do I know that installed? How do I know that? Where do you think we could look?
Well, if you remember, we could go back to our
We go to places we can go back to our software center. We clicked. Darrell shows all the software center and that what's been installed. So let's check there first.
Hopefully you remembered in this way, that was your answer.
Now, instead of going to all software, I'm just gonna go to installed
as installed, comes up here,
Let's go to history.
And today and there it is,
showed today that I actually downloaded departed
Where else can go, I can go here
to my spotlight on my search tool I could type g parted. There it is
It's gonna ask me for a password to run the deep part of tradition editor again. It's just my administrator password on my regular user account password Lets go Launch Cheap Parted.
Now what is it doing right now? It's searching my partitions to find G part in. This is gonna come up and still launch the actual G part of program.
I'm not gonna waste your time watching paint dry, so let's just skip out of that now that we know where to look for a software.
That's the nice thing about command line. Now you'll notice
me when I when I by going out and actually having to find the software, download it once I downloaded going to download fuller click Double clicking on the X, C and windows.
By doing that, I've taken a whole bunch of time, right?
So in linens here, all I did was type of single command and it downloaded a download, went up to the Internet, found a package downloaded it. Unzipped it
asked if I want to keep asking. I wanted to install its gonna take up this much this space. It shows me all that's built in. I typed yes and done Bang. It's totally installed
on and taking care of. So it's It's a much easier and quicker process than actually going through the process, going to Internet Googling and finding the package you want downloading et cetera.
Your typical way that you'd install an application
in windows or even in lyrics. So using the command like to be a very powerful tool. So that's just one wondering. So now if I go to do the same command again, app get
again. It's not gonna let me I have to use the suit to command every time. But I wanted to, but I'm gonna do something that requires route privileges. Okay,
Now let's say you want to. Just You're tired of typing, sued over and over and over again. A quick command that you can use. This is a little a little tip for a trick that you can jot down our commit to memory. Use this occasionally when I'm just when I'm in the process of doing a lot of administrative things, editing files, etcetera. I just want to be
at the root type level. I could take Sue
What that does is it drops me right into, like, a root type account. If I type act yet
automatically. Didn't ask me for a password. It didn't ask me for anything like that. So if I am an administrator and I'm not logged onto the route account, which you can't do that gun too.
But I'm just gonna do Sue bash. So I'm constantly en route, and I could do the administrator from that one that you don't want your your regular users to have its power. So you're not gonna You're gonna put a password lock up so they don't actually have these permissions rights. But
you will, and you'll know about it, and you can do that. Enough. I want to come out of that room is type exit. I'm back to just being cyber Eri Admin.
so there's two different ways you can do that that will help you thio navigate a little bit easier.
So some other commands that we can go over,
they're very helpful. I'm gonna give you a couple.
The last command is a really good and helpful tool to use to understand, kind of gives you a little bit of an audit trail. Who's been doing what, what, what they've been doing for how long they've been doing it, what account they used. So I'm just gonna type last.
It's gonna show me basically a paper trail who's been using a lot. So here's a cease. I bury admin
along on January 29th 23 13 still logged in.
But these other times I also logged in. I used this one time here five minutes, one for 11 minutes. Here, 22 hours. It was up and I was logged in
et cetera and tell them what I did. I did a reboot here, another reboot system reap of here and tells me all the things that what's been going on with last command.
Okay, so this is a really good way justice to see who's been using a computer.
And, you know, if you do that, you can find out something's happened and you could You need to find out who's who's done it, tracked the user down, and, you know, for disciplinary issues or tracking down to help
give them. Now, if you understand how to fix the issue they broke,
this is Ah, this is a good way to go.
Case. Let's the last command.
is another good command. You're gonna use this if you need to, you know, give you an idea of the free space If you feel like a snapshot of what you're just spaces. Okay. Um, so
all you do is basically type D f
j just give me, like, right away a snapshot of my file system.
Much space. Amusing How much space I have left? You could see right here on death sda one. If you remember back when we're installing Lennox, Move on to that.
The devices sda one, my raw devices. Just SDA. But SDA one is actually my route. Partition
tells me how much I've used
how much is available. Tells him. It tells me I'm using 22%
you know, fairly good information. Have If you need to know if you need to be jumping around and figure out if you're pressed for for hard disk space me understand how much you got left, that's a good command to use. Okay,
also, let's just say you're doing a lot of RAM intense or memory intensive applications of processes You want to know how much ram do you have left?
Another good command is the free command that does that gives you a snapshot of your memory. Okay,
how much memory you have on your system? So it's another good command to use Kay. Um, another good command is the d you command Duke man.
Um and that's how you can find out
how big an actual file is. So
we have a file, and just for the purpose of this, let's go ahead and named the smiles we could get an idea.
This is There's nothing in it. I'm gonna open up this file that we created a lot in the last, uh, the last part.
this is a test. Let's file.
Okay? It's on my desktop.
I'm gonna go to the directory. That file's in, right? And where is that file? So it was going here. Is it in here?
It's is not in here is actually in my, um,
So what I need to do is print working directory that tells me where I am. A mint route. Well, I need to go to
my real drinks. We could do this. The number two is you actually go to the directory that file system exist in, or you can type the entire path of the file.
Let's do them both. So as you can see the difference, let's start with typing the entire path.
What this do command is gonna do is actually gonna tell you.
you know it will give you It will give you an idea of how big the file is. K.
It's It's There's different switches. You can use for the dude. Ashby where when I say switches, it's the dash B or the dash A By doing l s dash a dash ese All to tell me all the things that are listed in that directory
The dash B is gonna be for bites. He'll give you exact figure bites.
Okay, so by default, if you just type, do it give you kilobytes. Okay, so let's let's give you let me give you an exact a couple of examples. So it's doing do let's go both ways of navigating that file. So if I do a first of all, if I just do a list for you, l s
home again. I'm using auto complete
by tapping out line. If I type my things, type h o I tap out in those days, I'm going home,
and then I'm gonna type desktop. I'm sorry, Sy Berry admin
And there's a mental doctor. Forgot to title this. Let's title it. Let's rename it
real title of test lyrics.
Okay. And again, it doesn't automatically show up. I actually have to do another l s. So I just hit my up barrow with same
there it is test leading stock. Okay, so now I'm gonna go ahead and do it. Do command to find out how big that file actually is. And again, this command is good for space saying, or if you have a command files, they're huge video files. You won't be able to free up some space quickly. This is a good command to use a drill down and find that file, see how big it is then deleted or move into a different
data store file structure.
And I'm gonna go to home
and then I'm gonna type test.
There's two different things called test so you can see how it it did A backslash after test That just means there's more than one thing. That's name. Start with the test. So let me go back,
backspace that I'm gonna do a test on a new space and time l
Inter sees no one. So let's just go there. Let's go to the director yourself
Twist and Leo to CD into desktop.
Control C Control sees actually how you get out of any commander and commands not working. Or if you're running a ping command and you need Thio,
stop being commandos in limits. The Ping Command does not stop. It just keeps going, going going much like a dash T and Windows system will keep pinging. Being over and over again doesn't stop. So in this case, I'm trying to get to ripen. Do it do
those. Which Fowler directory.
Okay, so, um, it's not working for So this may be a red hat or a fedora. Sendoffs type specific command.
It depends on the legs. Destro. But this is a command that you can use another just rose that you can actually go and see how big or file it actually is. OK,
um so it's just one of the command,
and let's see here. Let's go to
P s command. Okay, this will give you a list of the process is running on your system.
So when we go back to route
okay and shows me the different processes that are running on my system right now,
you know, with different things. Okay. And what else? It seems well, good contenders kill command
kill, you know, implies death way. We're talking about process. I d Did you want to kill? A specific process is kind of like your tests passed, Manager. You can do in the command line
kill specific processes, but we're not gonna
Well, I couldn't do anything because we don't want to kill you know any of our specific processes? Que, um
no, let's try V. Find command.
Fine command. If I do, that's going to go through all the processes you can see. It's just going, going, going, going right? Because I did. If I find that I did a wild card of the asterisk there
still finding it Sze kind of absurd to do that is going through every single thing
on. Did you do this? I am buying by mistake and just hit the control, see? And it will stop it in its tracks. Right?
But those that's how you could do You could do a find process, and it will find it that you can do it. Kill it. You need to do that, and you can go go there, do those different commands. So there's there's some other commands. So let's look at some basic network commands. What if you want to find your i p address again, you talk if config
And that tells your I p address, etc. Rosier your network card, your network interface you confined there
you go with that. See what other commands you can use. Um, is
l s really Okay, this is this is listing your your files in your ownership of your file system. You could see the ownership here of your file systems.
So, uh, you're different files in your fastest. OK, so you can see in my directories here that bin directory and this is in a reed, right? Execute, read, right, Execute. And who could do what? We'll cover that later. In the permissions of file ownership section of this course.
This gives you an idea of what it's like, what it looks like.
Okay, with l s minus. L. A. Is gonna show you all the different
Who owns the fire? Who has rights for the files and who owns the files here? You could see that route is all the files.
Obviously, this would look a bit different. If you're in a larger organization where people have access to a shared directory,
you'll see that it would be a bunch of different user names with different, uh, different file names, different user names in different permissions for each file.
And again, Like I said, you can see here that these were actual these air, actually, the permissions
read, write and execute R W X. Okay, so they're some of the other commands that you can use.
Okay? And we're also gonna look at the
copy in the move command.
So I created my file again. This is gonna be a little bit more of this. Could be a little bit longer module. So are not part of this module. So if you need to take a break, by all means, take a break. I'm gonna keep going and stop and go back. Go forward if you need to, but we're gonna go on the next type commanded, uses a copy and move command. So it's gonna be CPI or
Okay, so I'm back to my test Lennix stocks. Let's go back and find that. So it is.
I'm in route so I'm gonna go back. Thio
Now I'm back to my home working many of my working drag my home working directory,
and I have my test legs up, So I'm gonna take my test folder. I'm actually gonna create another folder, full room, you name it
And I want to move that dock into the test folder, right?
again. This case since the test
And again. So Lenox doesn't like spaces in filings,
you know what I'm gonna do to make this easier. So when when you have a space and a file name, you have to put a backslash in its place. Otherwise, it will be able to read the file name. So to make this easier, I should do this in the first place. Won't go ahead and rename this file.
I'm just gonna rename without the spaces.
So my apologies on that. Let's just make it easier.
Well, this this would be something you might encounter with users in your organization.
And let's let's remove the spaces in the folder. She was just making it easy.
Now you can use underscores as well if you need to make it easier.
I tried to capitalize the first letter of every word.
So let's back this out.
Let's just do a list again. All right? So you could see the renamed there.
Let's see if that fixes, aren't you?
Yeah. Okay. So you can see that the Do command actually does work with this. It just needed to be the spaces were throwing off. Okay,
so that gives you an idea. This is 55 bites. Now, if I just do it, do
Yeah, is dead killed by so four kilobytes. Right. So what we need to do now is we want to move it. Okay, so we're gonna move and let's look at our
I guess we're going to move it from
desktop to one. File one file level up
to run to envy. In the name of the dock
Now, you can see if you're watching on the desktop. It just disappeared
from the desktop. Worried to go. That's fine. We go. So let's go back or ah, PVT. Let's find out where we are. So let's go back. We'll run desktop by the sea needed It takes me back one level and now I'm back at the my heavy D is now home cyberia Admin. If I do a list, there's gonna be my document right there. Test leading stock.
So that's the way that you could move files files around in your file system in your in your directories.
Now, hold it. Copy. Want Take a copy of that document in place in a different directory. I want it back on the desktop. So I'm gonna do a CPI test winning stock too,
test when he stopped, I want copy it to home
and you can see that it appeared back there on the desktop.
So it's moving. Copy. Okay. And so I'm now, I want to go back to listing it,
and you can see that I'm
I'm still in cyber admin where I moved it originally. It's still there. There's now just a copy in desktop. So we go to see the desktop do list. You can see that testimony docks, test clinic stock is there. So we're going to move it into a folder. I can do that as well. I could do it. Move still. Copy what we'll do. Moves. You can see this pier.
So I'm in the desktop. Right? Go to move,
Let it stop. You want to move it to
and it's disappeared again. Check.
Now. I want to go and, uh, list my directory test for some of CD into
when there's my document.
Conversely, I could just go over your test colder and double click on it. And there's the documents. Well,
so the ways that you can move around the file system was where she seem common
common commands they're gonna use day in and day up to get around the false system to make commands, et cetera. And what we're gonna do is we're gonna go ahead and wrap this one up, and we can talk a little bit more about the actual making of the directories and making the files. And another another
Montreuil that's gonna be model three and sister administration module.
But it gives you an idea of the power of the command line of what it could do for you how to use it, how to move around the file system. It's a very good tool to use, and if you get good at it, it's a very good skill set toe. Have
a lot of jobs out there require that you have some command line experience. So,
uh, take this module, Watch it over again. If you need to. Really just play around that, create your own files, try and move around. Try copying them. We're gonna go. We're gonna do some removing and deleting et cetera and one of the other in Module three and this administration module. You'll see what it's like that to remove
directories and files and and make them etcetera, so we'll get more into the system administration of it. You're gonna get some more good hands on
experience with it and play around the sorts. It's really at this point. Time should really have your own either live CD that you can play around with or your own isolation so you could do hands on labs
and we'll have some in module four for exam pressure preparation. When I put together some exam, some hands on lab exercise that you used to play around swell.
So that's it for now. Thanks for watching Hope you enjoyed it