디렉토리내의 json 파일 중 "system_user"와 find me라는 단어가 포함된 파일들을 찾아서 이동시키는 스크립트
#!/bin/bash
RESULT=(`find ./ -name "*.json" | xargs grep -l "\"system_user\"" | xargs grep -l "find me"`)
backup_dir="/var/log/backup"
for elem in "${RESULT[@]}"
do
mv $elem "${backup_dir}"
done
'언어 > Sell Script' 카테고리의 다른 글
| rsync, expect 를 활용한 data 백업 (0) | 2022.12.09 |
|---|---|
| Shell Script (0) | 2021.08.31 |
| Shell ? (0) | 2021.08.26 |