Editing text can be time consuming. To save time, gedit includes a Replace function that helps you to find and replace portions of text.
Open the Replace tool by clicking Search ▸ Replace or press Ctrl+H.
Enter the text that you wish to replace into the 'Search for:' field.
Enter the new, replacement text into the 'Replace with:' field.
Once you have entered the original and replacement text, select your desired replacement options:
To replace only the next matching portion of text, click Replace.
To replace all occurrences of the searched-for text, click Replace All.
Use the Replace All function with care. Replace All works on the entirety of your text file, and does not allow you to highlight portions of text where the replace function will be performed.
The Match case option allows you to specify whether you want your search to be case-sensitive. If this option is selected, searches will be case-sensitive. If not, searches will not be case-sensitive.
Use this option to search for a specific word without including fragments of other words. For example, if you searched for the word 'and' with this option selected, the word 'and' would be matched, but the words 'sand' and 'commander' would not be matched.
This command behaves identically to the Find Previous command. If you wish to step through search results from end to beginning, select this option.
With the wrap around option enabled, gedit will re-start the search/replace action at the top of the file after it has reached the bottom of the file. This ensures that your search/replace action is made across your entire file.