Replace String in all files in Eclipse

How can I search and replace a String in all files of my current project?

Let's say I have the string "/sites/default/" now I want it to be "/public/sites/default/", but there are almost 1000 files.


  • Goto "Search"->"File" from menubar at the top left
  • Enter text, file pattern and projects
  • Click "Replace..." button at the bottom
  • Enter new text click ok

Voilà...


Depending on the file type you are focused on, Ctrl+H will open up different types of search screens.

A more consistent hotkey would be using the Alt method: Tap Alt, then A, then F.

Efficient Order of Operations:

  1. Ctrl+C the text you want to do the replacing (if available)
  2. Highlight the text you want to be replaced
  3. Tap ALT, then A, then F. Brings you to File Search. The selection from (2) will auto-fill the search box
  4. In the “File name patterns” input box, type in “.java” for replacing all Java files or type in "" to replace in all files
  5. Click “Replace…”
  6. Ctrl+V (Paste). Or type in the value you want to do the replacing
  7. Enter

You can find more details in my blog post: http://blog.simplyadvanced.net/android-how-to-findreplace-in-multiple-files-using-eclipse/


Use Ctrl+H for opening Eclipse search dialog, select appropriate search tab and select "Replace..." to get you to the "Search and replace" dialog