how to exit nano This is a topic that many people are looking for. bluevelvetrestaurant.com is a channel providing useful information about learning, life, digital marketing and online courses …. it will help you have an overview and solid multi-faceted knowledge . Today, bluevelvetrestaurant.com would like to introduce to you Linux Commands for Beginners (Old Version): 05 – Nano. Following along are instructions in the video below:
“Everybody. This is j and welcome to my fifth linux command tutorial video and in in this video. I m going to show you the nano command. Which is actually text editor that runs right inside your terminal window.
It s really useful so to access. It all you have to do is type n. A and o. Just like that and press enter.
And you should see a screen that looks exactly like this and immediately it s ready to accept keyboard input. So you can start typing right away and pressing the enter key goes down a line just like you just like it would another text. Editors you might have used the backspace key also works like you d expect as does the delete key and it s really useful if you were just wanting to type some notes or edit. A config file the nano command is something that you ll probably find yourself using quite often once you get the hang of it and it is really easy to use on the bottom you see all the commands that you can access with the ctrl key.
So for example. You see x. It is control x. So if i hold ctrl and press x.
It s going to allow me to exit the text editor. But because i ve made changes. It s actually asking me you know are you really sure you want to do this..
Because you haven t saved it that s fine. I ll just say no by pressing the letter n. And anyway going back into nano and other commands that you can do so i ll just get some sample text in here just so you can see how this works now if i did want to save this this file. I can hold ctrl and press.
Oh as you see here ctrl. O. Is right out. Which is the same as save essentially so hold control press o.
And it s going to want me to give it a command or excuse. Me a file name. So i ll give it test. Dot txt and press.
Enter. And then i can exit the text editor as you see here by holding ctrl and pressing x. And now you ll notice when you do ls for list storage. In this folder.
You ll notice that the file that i saved is right. There test txt so and this leads me to another way to access the nano command. You can actually give it the name of a file you want it to start with in this case..
I ll give it the name of the file testy. So i can continue working on that file. And there you go so i just brought the file back up. So that s how you save a file exit and bring it back up.
But there s other things you can do as well so for example. If you hold ctrl and press w. You can search for a string. So i only type one thing.
So of course. It s going to bring me to the very first instance of the search string that it finds. But if you are searching for a specific string for example. If you re working on a config file.
And you re looking for a line that that has a certain configuration you re looking for then you can search for that line and find it so for example. If i have something else in here. Say i don t know turtle. I guess.
And i go back up here to the top ctrl w. And i search for turtle well. I got actually spell it right it ll bring me right to the first time it sees that specific word..
So if you want to copy and paste. It s actually ctrl k to cut so it s not ctrl x. Like it would be in other text editor. So if i hold ctrl and press k.
I just cut that word out so it cuts everything away from the insertion point. And say for example. I wanted to paste its control u. As you see here for on cut.
So control u. And i paste that item back in and i ll let you go ahead and play with all the other options. But there s that s really all there is to it. Though there s not a whole lot else nano is a really simple text editor.
The only other thing that i can show you that i haven t showed you yet is that the nano can actually edit text files. Even if the text file is not in the current working directory so for example if i go back to the root of the file system. I can t if i type nano space test txt it s going to create a new file. Because there is no file named test2 x t.
In that directory. But since i already know i do have a file called test txt. I could tell nano exactly where it is and oh space than the path home j lacroix documents text..
Dot txt and that is a new file what did i do o test dot txt. I m sorry there we go so if i type the path to a file then i can edit any file i want without having to cd into that directory first which is really useful and i ll give you a real word world example. If i wanted to edit my samba configuration. I could do sudo well i won t do that i ll do nano let s see samba smb dot com.
And that i can edit my son but configuration file from anywhere. I m sorry about the whole sudo thing. I ll show you that very soon what that actually means so ignore that part but that s how you use the nano text editor. And it s a very important tool to know and very useful when you do linux administration and you re editing config files.
Or if you just want to create some quick notes for yourself and stored them in your home directory. Or something like that it s a really good text editor. So with that said thank you for watching. And i look forward to making more videos for you in the meantime.
Please subscribe. ” ..
Thank you for watching all the articles on the topic Linux Commands for Beginners (Old Version): 05 – Nano. All shares of bluevelvetrestaurant.com are very good. We hope you are satisfied with the article. For any questions, please leave a comment below. Hopefully you guys support our website even more.