Find and replace in Nano

Q: How to find and replace a string in Nano?

A: The answer is straightforward, while you are in Nano,

  1. Press Ctrl+\. Notice that a box appears in the bottom of the window
  2. Then type the string you are trying to find and press Enter
  3. Then type the string you want to replace and press Enter
  4. At this point Nano jumps to the first instance of what you are looking for and shows you a set of shortcuts to go and find one by one, by pressing y for accepting and n for skipping, or replace all by pressing a

For just finding a string, you can use Ctrl+w to ask Nano to jump to the first instance of the string.

One thought on “Find and replace in Nano”

Leave a Reply

Your email address will not be published. Required fields are marked *

This is new type of CAPTCHA, make the puzzle please !WordPress CAPTCHA