찾아서 바꾸기
-
Ubuntu에서 하부 디렉토리의 모든파일의 내용 찾아서 바꾸기개발 이야기 2023. 2. 21. 15:50
우분투에서 현재 및 하위 디렉토리의 모든 파일에서 abc를 xyzg로 바꾸는 명령은 다음과 같습니다. find -type f -exec sed -i 's/abc/xyzg/g' {} + -type f only find files (exclude directories) -exec for each file found execute … sed -i edit files in-place s/abc/xyz/g replace all occurrences of "abc" with "xyz" in all lines {} + invoke the "exec" command with multiple file names at once, instead of once per file