Find & Replace in nano (Linux & OS X Terminal Text Editor)

"dwarf”Is the easiest for many users text editor for Linux and / or OS X. Although I have been using it for many years as a text editor for both Linux (via Sideboard or SSH/Putty) and for OS X (via Terminal), the other day I experienced for the first time the "find and replace" command. Specifically, to replace in a text file identical words / phrases with other words or phrases.

Find & Replace with nano in Linux and OS X 

1. sudo nano / folder / filename (To open the file you want to edit)
2. In nano editor, press Ctrl + \. At the bottom of the editor will ask us to enter the word or phrase to be replaced (Search (to replace):). Enter, after entering the text to be replaced.
3. Introduce new text that will replace the one entered in step 2. (Replace with:). Enter.
4. Press the “A”To replace all found phrases / words.
4. Ctrl + X then the key "Y”To save changes and close nano editor.

Nano Text Editor and help commands: nano -h

Passionate about technology, I enjoy writing on StealthSettings.com since 2006. I have a rich experience in operating systems: macOS, Windows, and Linux, as well as in programming languages and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, PrestaShop).

How to » iHowTo » iHowTo - macOS » Find & Replace in nano (Linux & OS X Terminal Text Editor)
Leave a Comment