找檔案並更新權限
find top-level_directory -perm -2 -type f -exec chmod o-w {} +
find test -maxdepth 1 -type d -exec ls -ld “{}” \;
find /dir/to/search/ -name “*.doc” -exec tar -rvf out.tar {} \;
find . -type f -exec tar -czf {}.tar.gz {} \;
同時刪除檔案
–remove-files
find $CHECK_DIR -type d -exec chmod o+x {} +
find $CHECK_DIR -type f -exec chmod o+r {} +
find $CHECK_DIR -type f -name “*.txt” -exec tar -zcf {}.tar.gz –remove-files {} \;
https://www.zymseo.com/big5/file_172340
[linux] find 基本語法操作
分類:linux