ETC

하위 디렉토리까지 뒤져 특정파일의 내용을 replace하기

EcusE 2002. 1. 27. 13:58
출처 : http://kltp.kldp.org/stories.php?story=02/01/17/8416340

작성자 : 지리즈

하위 디렉토리까지 찾아서 파일 내의 특정한 내용을 바꾸는 명령입니다.

find . -name *.html | awk '{ print "cat "$1" | sed "s/바꾸고싶은말/바뀔말/g" >"$1 }' | sh


아래는 댓글입니다. find . -name *.html -exec perl -pi -e 's/바뀌고/바뀔/g' {};


관련 링크: http://kltp.kldp.org/stories.php?story=02/01/17/8416340