V
V
v_k2011-03-04 00:40:13
linux
v_k, 2011-03-04 00:40:13

Recursive find and replace text in Linux files?

Is there any Debian package for the subject?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad Frolov, 2011-03-04
@v_k

find . -type f -name '*.py' -exec sed -i -r 's/regexp/new_replacement/g' {} \;

Will replace in all *.py files starting from the current directory the regexp line with new_replacement. (you can use regexp expressions)
Live example:

I
Imbolc, 2011-03-05
@Imbolc

When manually confirming each replacement is critical, there is a good GUI tool: regexxer.sourceforge.net/
deb package is:sudo aptitude install regexxer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question