SaltyCrane Blog —  Notes on Python and web development on Ubuntu Linux

How to do a global search/replace across files in Eclipse 3.2

The location of this command is not very intuitive. To search and replace in multiple files you need to select "Search" > "File...".

Step by step:
  1. Select the text in a file
  2. From the "Search" menu, select "File...". This will bring up the "Search" dialog box.
  3. At the bottom of the dialog, click "Replace..."
  4. This will bring up the "Replace" dialog box where you can type in your replacement text and replace individual occurrences or all occurrences.

18 Comments — feed icon Comments feed for this post

#1 Tom commented on 2007-09-23:

Thank you!

I was having trouble finding this. Very useful for large projects.

#2 LindsayStanleyKay commented on 2007-12-21:

I'll second that, cheers! I was about to hunt for some sort of plugin to do global search and replace!

I wonder if there is any way to do refactoring across multiple projects, ie. update import statements, references in dependent projects etc?

#3 Igor Milovanović commented on 2008-06-15:

thanx. that was what i was looking for... sometimes you just need to look a few more seconds :)

#4 asawari commented on 2008-07-09:

Hi...I am developing an application in eclipse rcp.I want to implement this multifile search functionality as is in eclipse in my application.can you help me with what plugins I should use.

#5 Leebase commented on 2009-02-17:

Thanks so much. This tip has saved me a ton of time.

#6 jibby commented on 2009-10-29:

why do they try to hide such a useful button? >_<

thanks!! :D

#7 Wojtek commented on 2009-11-24:

well, Eclipse UX sucks. Thanks for revealing this so hidden (really) functionality

#8 jim pruett commented on 2010-07-22:

'have been using Eclipse for 12months and you have finally shown me how to do File-S/R... Thanks!

#9 Harikrishna commented on 2010-10-13:

Wonderful tip !!

#10 Kamal commented on 2011-08-16:

Thanks for sharing the hidden function in eclipse

#11 Scott commented on 2011-10-13:

Yes thank you :) I was having trouble find it also. I think they might be trying to save us from accidentally replacing content in a ton of files we weren't expecting. A bit of a sanity check before doing the replace. They could accomplish the same thing with a warning message with the number of files that will be affected though :p

#12 Howel commented on 2012-01-11:

thanks so much ! Very useful tools

#13 Ankit Jhalaria commented on 2012-02-22:


#14 Phillip Brown commented on 2012-03-14:

Thank and keep sharing

#15 Meredith Prince commented on 2012-04-16:

Thank you! This was very helpful.

#16 Rakesh Wagh commented on 2012-07-10:

thank you!

#17 Stephen commented on 2014-12-02:

I've been using Eclipse for two years, and never knew this was there!


#18 Yu commented on 2015-01-01:

Oh boy, I needed this, thanks!

Post a comment

Required, but not displayed

Format using Markdown. (No HTML.)
  • Code blocks: prefix each line by at least 4 spaces or 1 tab (and a blank line before and after)
  • Code span: surround with backticks
  • Blockquotes: prefix lines to be quoted with >
  • Links: <URL>
  • Links w/ description: [description](URL)
Created with Django and Bootstrap | Hosted by Linode