-
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반응형'개발 이야기' 카테고리의 다른 글
[Mac OS] MS Word Crash 문제 해결 (EXC_BAD_INSTRUCTION) (0) 2023.08.31 [Mac OS] MS Word에서 문서구조 표시 단축키 설정 (0) 2023.08.22 Ubuntu에서 pdf 이미지 crop하기 (pdfcrop) (0) 2023.01.31 [PyTorch] CDF, ICDF function 구현 (Normal approximation) (0) 2023.01.20