LinuxDave

Life, Linux and Crazy Videos

Find and Replace multiple Unix/Linux Files

Filed under: Linux — December 21, 2005 @ 4:21 pm

Need to do some substitution on multiple files? Try this command:

find ./ -type f -exec sed -i 's/findme/replacewithme/' {} \;

1 Comment »

  1. Greg:

    or you could do:

    perl -p -i -e ’s/findme/replacewithme/g’ filenames

RSS feed for comments on this post. TrackBack URI

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

(required)

(required)