Find
ph
- 모든 실행파일 찾기
일단 file * | grep executable 이 제일 간단함. find명령으로는
find . -depth 1 -perm -u+x ! -type d
symbolic link까지 찾는다는게 문제. ! -type l 로 거를 수 있으나 ln의 source file이 executable일 수 있음.
- 오늘 바뀐 파일 찾기
$ touch -t `date +%m%d0000` creteria ; find . -newer creteria -type f
- 최근 1분간 바뀐 파일 찾기
$ find . -mmin -1
- 최근 24시간동안 바뀐 파일 찾기 (출처: http://www-903.ibm.com/kr/techinfo/pseries/tech/techdoc4.html#bb )
$ find /<filesystem_name> -xdev -mtime 0 -ls
- 찾아서 etags
find . -name '*.cpp' -or -name '*.h' | xargs etags --append
find . -name "*.[chCH]" -print | etags -
- 크기가 큰 파일 찾아 sort (출처: http://www-903.ibm.com/kr/techinfo/pseries/tech/techdoc4.html#bb )
find / -xdev -size +2048 -ls |sort -r +6
(+6 option did not work on CentOS 6)
- find symbolic link files those are not containing 'external' string in their full path.
find . -wholename '*external*' -prune -o -type l -exec ls -l '{}' \;