#author("2022-08-04T22:46:35+09:00","","") #author("2022-11-12T23:09:52+09:00","","") #topicpath /////////////////////////////////////////////////////////////////////////////// * 目次 [#x4f92252] #contents(); /////////////////////////////////////////////////////////////////////////////// * find [#e4f6a320] /////////////////////////////////////////////////////////////////////////////// * 使い方 [#cab8b8d3] - 詳しくは、 man find を参照 //============================================================================= ** 複数パターンのファイル名を or 条件で検索する [#yc48b874] - *.cc か *.h に当てはまるファイルをリストする $ find . \( -name '*.cc' -o -name '*.h' \) ./des_old.h ./des_ver.h ./rpc_des.h ./spr.h ./des.h ./des_locl.h ./times/aix.cc ./times/alpha.cc ./times/hpux.cc ./times/usparc.cc //============================================================================= ** 一定のファイルサイズ以上のファイルの検索 [#g03f921a] $ find . -size +100M # 100M以上のファイルを検索 //============================================================================= ** 実行可能ファイルの検索 [#i936f001] $ find . -executable -type f $ find . -perm /u=x,g=x,o=x -type f //============================================================================= ** ELF のみ検索 [#ld9c862b] $ find . -executable -type f -exec file {} \; | grep -i elf $ find . -exec file {} \; | grep -i elf //============================================================================= ** 最終更新日時付きで表示する [#peb61f72] $ find -printf "%TY-%Tm-%Td %TT+%TZ %p\n" 2016-12-03 21:18:15.0645873030+JST . 2010-06-29 07:16:27.0000000000+JST ./acinclude.m4 2012-08-04 23:25:20.0000000000+JST ./aclocal.m4 2010-06-29 07:16:25.0000000000+JST ./AUTHORS 2012-08-04 23:24:51.0000000000+JST ./ChangeLog 2012-06-15 23:08:23.0000000000+JST ./compile 2012-06-15 23:08:23.0000000000+JST ./config.guess - $ find -printf "%TY-%Tm-%Td %TT+%TZ %p\n" | perl -pe "s/\..*\+JST/\+JST/" 2016-12-03 21:18:15+JST . 2010-06-29 07:16:27+JST ./acinclude.m4 2012-08-04 23:25:20+JST ./aclocal.m4 2010-06-29 07:16:25+JST ./AUTHORS 2012-08-04 23:24:51+JST ./ChangeLog 2012-06-15 23:08:23+JST ./compile 2012-06-15 23:08:23+JST ./config.guess