find

Table of Contents

概要

Search for files in a directory hierarchy

インストール方法

インストール

findutilsドキュメントを参照してください。

チェック

$ find -version
find (GNU findutils) 4.7.0-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)

命令説明

構造

find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]

  • find . -type f -name *jpg -exec cp {} . \;
  • find . -type f -size +10000 -exec ls -alh {} \;
  • find . -atime +1 -type f -exec mv {} imsi\;
  • find . -name "-F" -exec rm {} \;
  • find . -exec grep -i "찾는 문자열" {} \;
  • find . \! -name "*.Z" -exec compress -f {} \;
  • find . -type f \! -name "*.Z" \! -name "제외할파일명" -print | tee -a /tmp/list
  • find . -name "*.ini"
  • find . -exec chmod 755 {} \; or chmod -R 755 ./;
  • find . -user xuser1 -exec chown -R user2 {} \; or chown -R user2 ./
  • find . -atime +6
  • find . -atime +30 -exec ls \; | wc -l
  • find /raid -type d -name "디렉토리명" -ok cp /복사할경로 {} \;
  • find . -name "찾을 파일" -print 2 > /dev/null
  • find . -perm 700 -print
  • find . \ ( -perm 400 -o -perm 200 \) -print
  • find . -size +1024 -print
  • find . -name core -size +2048 -print
  • find . -mtime -7 -print

関連項目

参考

  • findutilsドキュメントを参照してください。

Date: 2018-02-20

Author: Dongsoo Lee

Created: 2018-12-10 Mon 03:11

Validate