nano is a small and friendly text editor in linux. It allows you to edit text, find and replace text, cut, copy, paste in your terminal.
Text editor in Linux | using nano command | with options and examples
![]() |
nano command |
Hello, guys welcome to the next session on Linux command line tutorial. In this session, we will see how we can use "nano command" in Linux.
"nano" is a small and friendly text editor and beside the text editing "nano" offers many extra features like an interactive search or replace.
And it also has some other features like go-to line or column number. It can show or it can give you the indentation in the file or some other features.
So let's see how we can use it.
Create a file and modify using nano
![]() |
Interface of nano |
$namo file name
I want to create a new file. So just write "nano" and then you just need to write the name of your file.
For example "nano file.txt" and press ENTER.
And then this is going to open this file and create this file in the terminal.
Save the file in nano
press ctrl + o
Now you may observe here that the file is open but it's not shown because we haven't saved the file.
So "nano" has created a file for us but we need to save it. In order to see it on your directory.
For example, I write some content in this file. Now in order to save this text inside this "file.txt" what you need to do is you need to press "ctrl + o"
"ctrl + o" it means to write out that means writing out to the file.
When you press "ctrl + o" and this will give you a kind of information.
Which says, filename to write "file.txt".
You just need to press ENTER and it's going to save the content of the file.
![]() |
open the file |
And when I open it is going to show the content of the file. Which we have inserted using "nano".
options in nano command
"nano" has some other controls like,
"Ctrl + g" - will get the help.
"Ctrl + x" - exit from the Nano command.
"Ctrl + k" - cut.
"Ctrl + u" - past.
"Ctrl + \" - replace a word.
"Ctrl + w" - find a word.
Conclusion
So "nano" can be used to create a different kind of files.
"nano" is good for editing some files which contain some code.
And it will do the highlighting or code highlighting for you. That's why "nano" is beneficial to use.
I hope you've enjoyed this tutorial please rate comment and bye for now.
HAVE A NICE DAY