Placeholder Image

Subtitles section Play video

  • please go to the line the computer guy dot com In order to view schematics, code and Maur for the projects that you are learning about welcome back.

  • So in today's video, I'm going to show you how to use the where is command and the fine command in order to try to do things like find the configuration files for the applications that you install on your server.

  • So you now know how to use apt hyphen.

  • Get in stone to be able to install Apache to install PHP dot i and I file.

  • And so you're all excited, right?

  • You can solve the operating system, you can install software.

  • Great.

  • Now you have a server.

  • But why doesn't the server do anything?

  • It doesn't do anything because you haven't gone in and modified the configuration files.

  • But here's a problem.

  • Here's a problem.

  • Insulin.

  • It's world Ln ex oil, right?

  • You already know how to use them, right?

  • You're like, Well, I know how to use them.

  • And so all I have to do is get to the files and I'll use vim The modify that the configuration files.

  • But the problem is of Lennox World is you have no idea where that hell the configuration files are.

  • And again, that is one of those big issues you run into with Lennox, where literally everything that you do with Lennox.

  • You either know how to do it or where things are or you don't in your kind of screwed.

  • So the where is and the fine commands could be very useful because these can try to show you where the files you're looking for are so that then you can use them to go in there and configure them again.

  • This is the important thing to understand.

  • With Lennox, right?

  • Ik individual component of Lennox is idiotically simple, right?

  • Installing Lennox is simple of them, Miss simple navigation is simple.

  • All of this stuff and stolen applications is ridiculously simple.

  • The problem that you get to it put in all the things together into a server that it actually does something that you need that's where it all again or like, just falls off a cliff s o again using the where is command and the fine command can make your life easier for trying to do things like find the PHP dot I and I file so the first command I'll show you.

  • Today is something called The wear is command.

  • So for this command, all you do is you simply say, where is all one word?

  • No spaces.

  • Where is and then a space?

  • And then whatever application you're looking for somewhere is a patch.

  • You too.

  • Where is PHP?

  • Where is fine if you want to do it.

  • And what this does is it shows you the folders where the configuration files and other files are stored for that particular application.

  • So this could be very useful again when you're getting used to Apache or PHP Or let's say just so, some other random ass application that you install in here onto your clinic server and you're sitting there and you literally just simply don't know where the folders are that that contained the information for this particular program you do.

  • Where is space?

  • Whatever the name of that particular application, as you use the exact same name that you use in order to install the app or to uninstall Leah or to restart the service's that's the name that you use and basically will show you the folders.

  • And so that's one of the ways that you can try to figure out things like what the configuration files are.

  • So hopefully you can simply use Google.

  • I can't.

  • Anna Lennox, World screw man pages, man pages.

  • That's also 2001.

  • In the real world, you use Google, but normally you go to Google and you try to figure and you could go to Google when you can figure out what the configuration files and that type of thing are.

  • But sometimes again, maybe it's a custom piece of software.

  • Maybe something weird.

  • Maybe you don't have the ability to get to Google for whatever reason.

  • Um, by being able to do where is and pull up all the folders where the configuration files and everything for the application are stored, you can then navigate to those folders and do a list command.

  • See what shows up go.

  • Oh, okay.

  • That's probably what the configuration file isn't that you've been trying to go edit it that way, s so that's what the where is command is relatively simple.

  • It's not.

  • You're not gonna use it every day.

  • You're not gonna probably not even gonna use it every month.

  • But simply knowing that the where is command is there will probably save your butt at least once a year.

  • The important command that we're gonna be using today is fine.

  • It's very simple.

  • Find command.

  • And so fine is a basic search command and Lennox.

  • But of course, being Lennox, you get a lot of options.

  • You get a lot of functionality, which is good, but if you don't know how to use them, they can be a pain in the butt.

  • So one of the first things that will say with the final command as if you're going to be searching from the root So from system route one of things that you want to do it finds you want to use Su Su super User.

  • D'oh!

  • The reason being again, one of the interesting things with five is you can navigate the route you can plug in the fine command.

  • But curiously enough, when the find is going through, the final grand is going through.

  • Actually, look for whatever it is you're looking for you as a normal user, even as the person who installed the operating system, the route, account or whatever, I don't actually have permission to get into a lot of the folders.

  • So if you simply do find you no hyphen name and then whatever name you're looking for and you do that from room and you do not you suit you will get lots and lots of lots of failures that we get very confused.

  • I get very confusing, a very frustrating And then you want to go off on your floors.

  • Curiously enough, all you have to do is you just plug in soo do fine space hyphen.

  • Name my name.

  • Whatever else on, then Whatever the name is you're looking for that will actually be able to go into all of the directories, find whatever it is you're looking for work and spit it out for you.

  • So the first thing to think about is if you put find whatever it is because we're gonna show you name and I name user and cement.

  • Today, I'm gonna show you a couple of arguments.

  • You can put it there.

  • Basically, if you plug that end and you get out a whole bunch of garbage.

  • I just realized you might want to try suit.

  • Try Sue knew before you give up.

  • So that's when the important weird quirks when it comes to the find in the Lenox Road the next.

  • The next thing to be thinking about is again Remember, in the Lenox World, capitalization matters, capitalization matters.

  • So you're gonna put in, find on, then you're gonna put in hyphen, and you're gonna use a name or I name to find the name of a file.

  • Here's the important difference between the arguments name and my name.

  • If you put in name, then that means it's ah, capital sensitive.

  • It's a case of case sensitive.

  • Right?

  • So lower case T t e s t dot t x t is different than uppercase.

  • T e s t t x t Right.

  • So if you put find hyphen name and then a single quotation mark on, then lower case t e s dot t x t close quotation mark in the hit Enter then it will only look for lower case T e s t not t X t.

  • If you have uppercase t e s t t X t, it will not find it because remember, that is a different case matters in the Lenox world.

  • So if you care about case, if you care about case you use the eye name argument so fine.

  • Hyphen I name and then single quotation Mark.

  • Lower case T E s T T X t closed lower quotation mark.

  • And if you do that, it will give you lower case T s t s t not the extinct.

  • I will give you uppercase d e s t t X t It'll give you everything that is spelled t s t dot t x t capitalization will not matter.

  • So that is one thing to be thinking about analytics world.

  • A name is case sensitive.

  • I name is not case sensitive.

  • So generally, how does use I name Unless you really know what you're looking for.

  • Just just that extra eye on there.

  • It will make your life a lot easier when the other things to remember is ah, when you're doing things like fine in the Lenox world thing asterisks is the star is a wild card, eh?

  • So let's say I'm looking for I'm not.

  • Let's say I'm not sure what the PHP configuration file is.

  • PHP die.

  • Let's say for some reason I don't know that.

  • So I could literally put it, uh, find hyphen.

  • I name a single quotation mark PHP star close single question mark.

  • And then what that will do is it will go through and it will look for everything that starts with P H P and then ends with literally anything else.

  • And so all of that will pop s Oh, that's one of things I think about.

  • Remember, the star of the asteroid is a wild card, so you could put that in front so you could put a single quotation marks star PHP close single British market.

  • Now it's basically that would be anything that ends with Ph.

  • B.

  • So you might look for I and II files, right?

  • You might say, I want to know all the eye and I files on it limits machine so I could do find hyphen, high name single quotation marks star at dot I and I know what that would do is I would find anything that ends in dot i and I.

  • So that's one of those things that you could be thinking about is to use the wild card one.

  • The other things you can use the arguments.

  • If you're looking into four files that are owned by a particular user, this might be valuable for you is you can actually use the hyphen user arguments of your new hyphen user.

  • Single quotation.

  • Mark it Whatever the user name is.

  • Close single quotation mark that will show you the files that are owned by that user.

  • So that might be valuable to you if you have multiple users and really not even just multiple users.

  • But, like if you have different service is and you've created users for that service is and you're trying to figure out what files the service's air using, that's only you could do a user and then another.

  • One of the interesting things you can do is you can actually searched by what files have been modified in the last X number of minutes.

  • So you can do hyphen, semen, hyphen, semen, C, C, C m i n space hyphen.

  • And then however many minutes and then that will show you the files and folders are the files that have been modified in that number of minutes.

  • So if you're going through when you're trying to see oh, you know, like, let's say you're editing right, you're sitting there, you're editing all these files and then you go crap.

  • I screwed up one of those files, but you forget which file you're like.

  • One of those I screwed up and I and I file I'm not sure which one it wants.

  • Well, you could do is you know, you've been working on your computer for the past 20 minutes.

  • You could do a hyphen, the semen hyphen 20.

  • And then we'll show you the files that have been modified in the past 20 minutes.

  • And they go, Oh, yeah, it's that one.

  • So those were some of the functionality that's very useful.

  • Using fine again with Lennox Lennox.

  • There's a whole bunch of other options.

  • There's 1000 other things that you can use find you could do a lot of amazing stuff.

  • I'm going to show you these couple of things just because I think they're the most relevant for you.

  • They're the easiest, understand?

  • And once you understand them, then by all means go to the man page and see all of this stuff that you can D'oh!

  • One of things I try to do with all these classes is basically just show you the smallest subset possible to make you feel comfortable with what you're doing and then you could go get go to man paid isn't figure out to figure out everything else.

  • So with that, let's go over the computer and I can show you how this works.

  • So here we are, my Avanti server.

  • Again, this is simply a virtual machine within virtual box.

  • Eso, whatever your host upper and system is, whether his Windows, Lennox or Mac.

  • If you're using virtual box and you insult Avanti server, you should be in the exact same environment.

  • Eso with this.

  • Let's just for a second ago.

  • And make sure we know where we are in the operating system in the folder structures.

  • D p W d.

  • Command it inner.

  • So we know we're in the Bob folder in the home, a folder in the system route.

  • The first thing I'm going to show you is how to use the where is command.

  • And again all the where is command does is show you the folders that contain the files for whatever piece of software that you're interested in.

  • So I simply could do where is space and then whatever I'm looking for, So I I install a PHP onto the server, so I can say Where is PHP?

  • I hit Enter.

  • And now that I did, we can see these are the folders that contained files for PHP, Ben PHP been PHP seven point to live, Doctor, Doctor.

  • So this gives us the locations that where we may want to go.

  • Now the important thing again where there's been PHP and Ben PHP 7.2.

  • This is the type of thing that might cause you a problem in the real world.

  • So you may be looking for some kind of PHP folder.

  • So you're not doing a fine you don't You don't do a list command.

  • You just simply navigate to a PHP for a packet Ford or something else.

  • And what you might not realize is possibly in the newer version of whatever you're using that it's created a different folder.

  • So, possibly instead of trying instead of needing to go to Ben PHP, you need to be in been PHP 7.2.

  • So simply by doing the where is command, you know, if you're having problems, you know Oh, crap.

  • I didn't know that folder existed.

  • Maybe that folder is where I need to go again.

  • This works with the almost anything so path you two is also installed on this You bunch of server ups.

  • Where is where is a patchy to enter and again for Apache too.

  • We can see there are fewer folders for Apache to And we got the s been We got the live we got the e t c share so so forth with Where is you can even do something as simple is fine So where is fined again?

  • So user Ben has fined and that's where the man pages are in.

  • This is where the info pages are.

  • So like, where isn't the greatest things that sliced bread?

  • Is this probably again?

  • You're not gonna be using this every month even.

  • But, you know, one of those times you're installing a new piece of software that you've never installed before trying to find that configuration file.

  • This is a type there.

  • Where is Yeah, let's let's see all the folders that that store information for this application s so that could be useful.

  • So with that, let's go and start looking at the find so clear the screen.

  • And so now we're going to be looking at find so again, P W D that shows us the photo rents on the Bob daughter in the whole quarter on.

  • Then let's take a look at what's actually in the Bob Ford.

  • So we do.

  • L s l a gets to give you an idea, eh?

  • So we have a folder.

  • So I simply created a folder called Folder.

  • And in that folder is a test dot t x t file, then we have test file, not t X t lower case test.

  • Dr.

  • E X t uppercase t arrest lower case E S T T X t all upper case T e s t t X t.

  • And so it is important to understand these are three entirely different files.

  • So, you know, depending on what you're looking for, you you may run into issues again.

  • Do the whole capitalization issue s.

  • So the first thing is, let's take a look at using name, right?

  • So if I d'oh simply if I simply do find if I simply do find, um space, uh, your name.

  • So when I use name, case, case matters, right?

  • So it is case sensitive, and then I do single quotation mark and then I do test not T x t close double quotation.

  • A single quotation mark.

  • So what this is going to do is from so fine?

  • I did not give a location.

  • I did not get location here, so find from starting in this folder going down.

  • So anything Lower.

  • Ah, fine.

  • Name case sensitive test dot T x t.

  • So find me any final called test dot t x t from this folder hit, Enter.

  • And so as we can see here, I have test that t X t.

  • And so this is this one here.

  • So this is in the folder.

  • So this isn't a Bob Porter, but then we can also see in folder.

  • And then there's also a test dot t x t.

  • So again, this could be one of those things you run into an issue of You're looking for a particular high and I file, and you literally might be modifying the wrong one for some reason.

  • Right, Though the FBI and I file the PH.

  • B.

  • I and I fail.

  • You're supposed to be modifying is one, and you haven't modifying the other.

  • So that's something to think about, um, again, one of things to be thinking about is that with that whole wild card again, we could do wild cards with Fine.

  • So we're gonna do is fine.

  • So fine.

  • And then we're still gonna do name.

  • And then I'm going to single the single quotation mark.

  • And then one of things I could do is tasked.

  • And then simply do that star That asterisk clips single quotation marks.

  • So what this is going to is from where we're at, So we're still where we're at Name So case, case sensitive quantifying test and basically anything that starts with test.

  • So I hit Enter here now and enter here.