Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- centos 8
- hardening
- xe guest utilities
- elastic stack
- docker
- Elasticsearch
- 보안양파
- freebsd
- endpoint security
- x-pack
- bash
- 로그인불가
- ELASTIC
- 한글가이드
- ansible
- proxycfg
- application security
- Kibana
- GitLab
- macos
- pfsense
- ssh key 배포
- Kibana server is not ready yet
- Proxy
- Windows
- miniconda
- PlayBook
- XCP-ng
- G-suite
Archives
- Today
- Total
선 밖에 선 자유인
find검색 및 문자열 치환 본문
- find 루 검색 및 perl, sed 를 이용 문자열 치환
- perl
$ find ./ -name <파일명> -exec perl -pi -e 's/<기존문자열>/<대체문자열>/g' {} \;
- sed
$ find ./ -name <파일명> -exec sed -i 's/<기존문자열>/<대체문자열>/g' {} \;
- 현재 디렉토리 하위의 모든 파일의 문자열 치환
$ find . -type f -exec perl -pi -e 's/<기존문자열>/<대체문자열>' {} \;
* find ./ -name ".php" 등의 패턴으로 특정 파일 지정 가능