Perform Find and Replace in Nano Text Editor

The operation Find and Replace, helps to save a lot of time for a developer, if you are working on editing a file using Nano Text Editor on the Terminal, then you can make use of the Ctrl + \ to enter the find-and-replace mode.


Step 1: Open the File with Nano

nano myfile.txt

Step 2: Press Control + \ to enter Search to replace Mode

 to enter find and replace mode

Step 3: Enter the find word/text and hit enter


Step 4: Enter the "Replace with" word/text and hit enter

Replace with option Nano

Step 5: Replace All instances? A/Y/N

Replace all instances Nano

Step 6: Result

Result - Replaced 1 occurrence Nano

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!