Nano is a popular text editor in Linux that offers many useful features. Sometimes you may need to search for a text in nano editor. In this article, we will look at how to search in Nano text editor in Linux. You can use these keyboard shortcuts in almost every Linux distribution, since nano is already present in most Linux flavors by default.
How to Search in Nano Text Editor in Linux
It is very easy to search text in Nano editor.
Press Ctrl+W or F6 to get search console. Enter the search term and hit enter to get to the first result. Enter Alt+W to continue searching.
Hit Alt+B to search backwards.
Press Ctrl+C to cancel any time and exit the search.
Also read : How to Copy File to Multiple Directories in Linux
How to Search and Replace in Nano
Here are the steps to search and replace text in Nano.
- Press Ctrl + \
- Enter your search string (e.g test) and hit return.
- Enter your replacement string and hit return.
- Press Y to replace next occurence, Pres A to replace all instances of your search term.
If your search term contains whitespace characters like space, tab, etc then enter verbatim mode first (Alt+Shift+V). Once you are in verbatim mode, then do as above. It will take in all the strings you enter literally.
Also read : How to Search in VI Editor
Related posts:
How to Run Shell Script as Background Process
Python remove item from list while iterating over it
How to mkdir Only if Directory Does Not Exist
How to Check Supported TLS/SSL Version in Linux
How to Save Grep Output to File in Linux
Linux Grep Binary Files for Strings
How to Provide Sudo Access to User in Linux
How to Create Empty Disk Image in Linux

Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.