Placeholder Image

字幕列表 影片播放

  • 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 a text editor called ofhim.

  • So text editors are very important to the Lenox world not because you're going to be trying to write the next great American novel using them, but because all of the configuration files in Lennox are written in simple, basic text.

  • So whether you're modifying something like the group files for for permissions and users and permissions with Lennox, whether you're changing the configuration file with an Apache or modifying the PHP dot I and I file things like that, you're going to basically have to end a text file.

  • So in the Windows world, you're right, Cliff collect, click, you know, do radio buttons, all that kind of stuff.

  • It's really nice and easy and pretty intuitive.

  • And the Lenox world we don't do intuitive in the Lenox world, we do text files, so being able to use a text editor is very important Now.

  • It should be understood that I will be showing you folks how to use Vimal today And vim is one of the Vale available text editors out there.

  • It is the one that I prefer.

  • It is the one that I like.

  • It is the one that I think is relatively easy to use and therefore that is the one I am going to teach you.

  • But of course, aboard this is Lennox World.

  • There's always 1000 ways to do anything.

  • And if there's 1000 ways to do something and Lennox, they're gonna have a whole bunch of people arguing about the best text editor and why you should use X, y or Z, let me explain something to you again.

  • For me being a little simple.

  • Sys admin.

  • I used the text editor to go in and literally modifying configuration files.

  • That's all I'm doing with these text editors.

  • Somebody's text editors are a very powerful, and you could do some really cool, sophisticated things that I never do.

  • So I'm gonna show you how to go in, modify files being create text files if you need to be able, go in and find configurations.

  • If you're looking for things, so I'm going to show you how to use them as just a very basic text editor.

  • But do you understand?

  • If you go out and you start talking to some old timer who does Lennox and you say Heidi has learned bam for Eli, the computer guy, they're probably going to give you a whole bunch of crab.

  • But, you know, honestly, no matter what text editor I taught you, you beginning a whole bunch of crap, so just kind of roll with it.

  • So in that, I'm gonna be showing you how to use them.

  • Today, let's go and dive into this and show you how this works.

  • So here we are, at my instance of a bun, too.

  • I have this running, of course, on virtual box on my Mac book pro.

  • But for them, whether you're running this in virtual box on a Mac book pro where they're running this on virtual box on something else or whether you're running this on a physical computer, everything will be the same.

  • So I'm using a bunch of 18.4 point three here if you're using them on a different distribution of Lennox.

  • Vamos, vamos, vamos mam should have.

  • So it should be the same.

  • And if you're watching this 10 years after I have recorded, this vim should still be the same.

  • This is one of those things that doesn't really came over time.

  • The only difference maybe, if you're using a different distribution of Lennox is one of the examples that I'm gonna use today is we're going to go and we're going to just modify, uh, the group file just to show you how to do that.

  • And so when a new bun to, I'll have to use pseudo super user do in order to be able to edit it with them.

  • So if you're using a different distribution of Lennox, you may not have to use the soup command in order to be able to edit something like the group file s O.

  • That may be the only difference.

  • So with that, let's go on.

  • Well, actually, log in.

  • So do Bob.

  • 123456 Then now we're Longden.

  • We get our basic information, so I'm gonna do clear now just to make sure where we're out of the world, I will use the PWD command to show us our files.

  • What folder were in And so we're in the bob colder and the home folder in the system route that will do.

  • L s to see if there's any files or folders with in this folder and we can see that there is not.

  • So the first thing that we're going to do is we're actually going to create a file.

  • Were going crazy little test dot t x t In order to do that, all we do is vim ve I am Do a space and then whatever want our final be called?

  • We're just not call this test dot t x t Um, now it's important, Understand the dot t x t doesn't really matter.

  • And a Lennox world doesn't matter if it's there, it doesn't matter, it's not there.

  • I'm just putting that.

  • They're just for my sake.

  • So we know what kind of file it is.

  • S o do remember unlike the Windows world, when you're dealing with a command line in Lennox, that final that dot t x t on that Suffolk's doesn't matter what we do them with you test that t X t and I hit in her.

  • Yeah, we're in a new file so we can see down here.

  • Test out T X t new file.

  • And this is what we got is we gotta go.

  • We gotta blinking cursor.

  • Islamics got a blinking cursor.

  • So in order to do anything with this file, what I need to do is I need to press lower case I That's where insert press, lower case I.

  • And now we can see down here it says insert.

  • And once I've done that, I can now do Hello, world, and then I can go down a few.

  • Isn't this cool?

  • I could go down if you say this is another lie.

  • And anyways, you get the point you go through and do all of these things past this, then if I want to be able to save the file, you want to save the file, I could just simply hit escapes that gets us out of the insert mode.

  • And then what I will dio is I will do colon so you can see down here you see the colon.

  • So I do Cole.

  • And in order to save and quit this final, what I'll do is w that is for right.

  • And Q is for which and so you will save banquet the file So now we have quit the file, Ugo and take a look So we do clear do l s and we can see test dot t x t e i du vem do test dot t x t I go in and there we go.

  • So we are seeing the file that I created before.

  • Now, at this point, you'll notice I'm not in the insert mode.

  • So if I try to type I tried a type I can't type right?

  • So if I try to do books But basically normally I don't know why I wanted the answer remote but normally you shouldn't be able to do anything.

  • So in order to do something, what you have to do is you have to I again I on by hitting the eye again.

  • You get that little insert mowed down here and then once you've gone into the insert mode, then you can start modifying what you want to say.

  • So I said, Hello, world.

  • We can now say hello, Bobo.

  • And there we go hit, escape.

  • So we just escaped.

  • So we escape out of the insert mode and then we can do colon and so there's a couple of things we could do here, so we can either do right and quit.

  • So if we want to save what we've done and quick, we do colon w Q.

  • As I showed you before.

  • But let's say I'm looking at this guy.

  • Uh, I don't like Hello, Bob.

  • I really preferred Hello world.

  • I don't like Hello, Block Bob.

  • So what you can do in order to quit and not save changes is you do lower case Q And then you do exclamation point lower case que exclamation point that allows you to quit and not save changes hit, enter and then we're back to where we were.

  • So again, take a look.

  • We do them Then we do test dot t x t He opened it up and it's back to Hello world.

  • That's pretty simple.

  • Now, if I don't do any modifications, it also.

  • If I do not edit this file, it all just sitting here taking a look, especially this is important thing.

  • Like, uh, you're looking configuration files.

  • We're just trying to find something.

  • Configuration file.

  • One of things I can do is I can do colon and then simply cute.

  • Just simply Q and this will quit is not right into quitting.

  • Is not quitting without statement, Candace.

  • Because we haven't made any changes at all.

  • So I could simply Colin Q and I hit enter and back here.

  • But I want to show you something that could be a real problem on Lenox Road.

  • Remember, capitalization matters in Lenox World.

  • That's I'm doing them.

  • Jim, my Oh, man.

  • What was that?

  • What was the name of that file?

  • Oh, that's right.

  • It was passed T X T.

  • Right, So I need to go, and I need to take a look at that test dot t x t file and see you.

  • But look here.

  • I did an upper case T lower case G s t not t X t and hit.

  • Enter What?

  • What?

  • I don't understand what's going on.

  • Well, this doesn't make any sense.

  • That's because I thought there was information in this file.

  • OK, well, let's see.

  • Right and quit.

  • Let me let me see.

  • Maybe maybe I went to the wrong file.

  • So what it must have been is them test?

  • Uh, t x t will do it all upper case.

  • Then we hit that.

  • And it's like what?

  • I don't I don't understand.

  • I thought I thought I thought it was You know, I thought it was a test dot t x t.

  • So I was gonna write and quit.

  • So it's created.

  • And what I really want you to understand is now, if I do at last.

  • So this lists and this shows us literally three files.

  • Where in the Windows world These would be the exact same names.

  • But in Lenox World, of these are three.

  • Yeah, these air three entirely different files.

  • Test dot t x t All lower case is a file test dot t x t t uppercase rest lower case of the file and test all of it Uppercase t x t is a fuck.

  • So I go here and I do them and I do test got t x t you go back, you can see our safe cr Hello world Isn't this cool?

  • And then if I quit this and ideo vim and then you test that t x t, we can see that we just get the question marks.

  • So it is very important to understand that these are different files.

  • They're different file names.

  • So you really have to make sure you stick with a standard of naming convention.

  • So we got your colon Q and then we're gonna get out of this.

  • So then the next thing that we need to look at it, why don't we actually take a look at a configuration file something that we might modify on?

  • So what we're gonna look at today is the group files the group file deals with group memberships for permissions within Lennox.

  • So we're gonna do is gonna CD and they were gonna go e T.

  • C.

  • We're gonna change to the E T C folder under system route.

  • And so here we're going to do is we're gonna go in and we're going to open the group file using them.

  • So the first thing that we do is we do V I am.

  • And then we do group.

  • So this is the file.

  • And when we open it up, the important thing to look at here is we didn't use the Sioux command.

  • Right.

  • So we look, group is read only.

  • So what?

  • Somebody's configuration files If you don't use pseudo when you go in to take a look at them.

  • Basically, all you'll be able to do is take a look at them.

  • You won't actually be able to modify anything.

  • S So that's that's not really what we want to D'oh!

  • So we're gonna quit out of this and then what we're going to dio clear.

  • And so we'll do Sue do down group.

  • So we're going to open the group file and using them and the pseudo command.

  • And when we do that, it's going to ask for a password.

  • 123456 Buck that in.

  • Okay, so now we're actually taking a look at this group group file right now.

  • So basically, these are all the different these air, the built in groups built the default groups and Lennox and this has the different membership so we can see things like Bob.

  • So I'm in.

  • Some of these groups assist log.

  • Is it one of these groups?

  • And so, basically, as you start building that south as a production server, you would have different users in these groups, and then you could assign permissions basically based off of groups and a Lennox world again, we will deal with all of that kind of stuff later.

  • Basically, this is what a normal them file looks like.

  • And so one of the things in this that we need to think about is if we're dealing with configuration files, especially text configuration files and Lennox World, when the biggest problems is, how the hell do you find whatever configuration that you're looking for?

  • So let's hear looking for user names or configurations or anything else.

  • So how do you find that?

  • How do you find that is?

  • You do forward, slash See down here at the bottom, you see where that floored slashes you do forward slash, and then you type in whatever it is that you're looking for.

  • So let's say I am looking forward, Bob.

  • So B O.

  • B.

  • So I'm looking for Bob.

  • And now when I look for Bob, it shows us the first instance of Bob appear, and it's highlighted that now what I can do is that I press inner and now we can see that it's now the blinking cursor.

  • So once I've pressed enter, then when I can do is if I press lower case in, it will go to the next instance of Bob in the file All right, so we can see that.

  • Now we're down here.

  • As I pressed.

  • Lower case in so late.

  • Lower case in allows me to scroll down when I'm trying to find Freida Word or whatever.

  • Then upper case end allows me to scroll up.

  • So I'm now scrolling up using upper case.

  • And so, in order to do a find, that's what you would do then let's say I find whatever it is I'm looking for, is I Okay, Um, I need to I need to remove Bob from this particular whatever group.

  • What I can do is at this point, I could do I.

  • So I typed in I and as we can see down here now says, Insert so down here it's answer.

  • So then I can go.

  • And since it's inserting, I can then delete this.

  • It's now deleted.

  • I can escape.

  • And if I want Thio, I couldn't do right.

  • Q and then this would this would write and quit so it would save and quit.

  • I don't want to do that right now, though, because I don't want to screw up this particular configuration file so I could go back here and I could type in bob again on then I can escape out of that.

  • And so now I haven't actually made any modifications.

  • But that's how you do find.

  • So in order to find you do the forward slash and then, you know, whatever it is that you're looking for, if it's Bob, uh, see now now basically finds from wherever your cursor position at the next instance.

  • But then I press enter and once I press enter, then I can go up so we can see the blinking is now up or I can do lower case in and I could go down uppercase and goes up lower case and it goes down and that's how you do it.

  • Hit Q on then exclamations as well quit without saving because we don't wanna actually modify or can't this file on?

  • There you go.

  • That's that's really all there is to the basics of them.

  • Yea, Now you know how to use vim Uh, edit and modify I and II files and configuration files and all that kind of stuff so you can go out there and you can have fun.

  • I will warn you, be careful again, especially when you're modifying the default configuration files.

  • And Lennox, if you do something stupid, if you make a modification that you're not supposed to mess with, basically you can have your entire operating system crash and not be recoverable.

  • So do genuinely be careful with that again, since it's text files one of those things like especially if you come from the Windows world used to deal with the registry or whatever looking, looking at a text file, it's really easy.

  • Look, a text file.

  • It's not really that big a deal.

  • I can edit this.

  • I can modify this.

  • It's not really gonna cause me any problems if I do something stupid.

  • But we have to realize in Lenox World that those those text files, those configuration files, that's that's how they operate.

  • System runs the operating system.

  • That's where it looks to be able to get the information that it needs.

  • And if you go in there and you do some stupid modification, Uh, well, these things might not go so well, but I just want to show you how to use them today again.

  • The other text editors out there there are much more powerful text editors where you do a lot of amazing cool things.

  • Even with them, there's some other stuff that you can d'oh you can actually do, like copy paste functionality, that type of thing with them.

  • But I did not want to overload you with that type of information because then people start getting confused and then they want to give up and go be floor.

  • So I just want to show you how to create a text file, using them howto edit a text file, using them to make sure that you really understand that the capitalization and all that matters with them and then how to do find again with find.

  • You do forward slash whatever whatever you're trying to find.

  • Then you hit, Enter, you hit enter.

  • That brings you into the screen itself.

  • And then from there you can hit lower case in lower case in scrolls down on the screen, finding the next instance of whatever you're searching for.

  • Upper Case in goes up in the screen in order to find the next instance of what you're looking for on.

  • So those air there something's think about.

  • The other thing, too, is again when you're carrying Gina configuration files like with group group is actually something that you will modify.

  • You may have to use Sue do in order to modify that to actually get in there so you can open.

  • You can open the file and view it, I guess using normal them.

  • But in order actually, modify that type of file.

  • You have to use soup to go in there.

  • Then you can modify it and away you go.

  • So that is the basics of vim.

  • As always, I enjoyed taking this clients and 40 in the next 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.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

Linux - Vim (Linux - Vim)

  • 6 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字