ほぼ自分メモですが、いいかげんfindを極めたかったので「Mommy, I found it! — 15 Practical Linux Find Command Examples」を超訳してみます。 Linuxでファイルなんかを探すときに使うfindの実用的な15例ですね。ここらへんを覚えておけば大抵の作業は大丈夫、かな。 では早速。 名前で検索 ここらへんはまだ基本ですね。 find -name "MyCProgram.c" 名前で検索(大文字小文字を区別しない) この場合はinameで。 fi...
- comment count (0)
- clip count (0)
- access count (1546)
-
- moppo
- 2764ポイント
- posted at:2009/05/10 19:58
■名前で検索
■名前で検索(大文字小文字を区別しない)raw embedfind -name "MyCProgram.c"
■検索するフォルダの階層を指定するraw embedfind -iname "MyCProgram.c"
■検索したファイルに対してコマンドを実行raw embedfind -mindepth 3 -maxdepth 5 -name passwd
■一致しないものを検索raw embedfind -iname "MyCProgram.c" -exec md5sum {} \;
■node numberで検索raw embedfind -not -iname "MyCProgram.c"
■パーミッションで検索raw embedfind -inum 16187430
■空のファイルを検索raw embedfind . -perm g=r -type f -exec ls -l {} \; find . -perm 040 -type f -exec ls -l {} \;
■サイズの大きなファイルを検索raw embedfind . -empty
■サイズの小さなファイルを検索raw embedfind . -type f -exec ls -s {} \; | sort -n -r | head -5
■ファイルの種別で検索raw embedfind . -not -empty -type f -exec ls -s {} \; | sort -n | head -5
■指定したファイルよりあとに更新されたファイルを検索raw embedfind . -type d
■ファイルサイズで検索raw embedfind -newer ordinary_file
■よく使うfindコマンドを登録raw embedfind ~ -size +100M
■大きなファイルを削除raw embedalias rmc="find . -iname core -exec rm {} \;"
raw embedalias rm100m="find / -type f -name *.tar -size +100M -exec rm -i {} \;"
- comment
- external reputations
0
comment
(2008/06/09 04:21)
by discovery
- 0clip
- 1432access count
- OS / UNIX,Linux
1
comment
(2008/10/04 05:01)
by akabone
- 0clip
- 2823access count
- Programming / programing language / PHP
0
comment
(2009/07/20 20:08)
by smile2525
- 0clip
- 943access count
- Programming / programing language / Ruby
0
comment
(2009/01/05 10:57)
by 1dumm2
- 0clip
- 1722access count
- Programming / programming tool / Emacs
0
comment
(2009/06/16 03:52)
by cyokodog
- 0clip
- 1989access count
- Programming / programing language / JavaScript
0
comment
(2008/06/12 20:14)
by zegenvs
- 0clip
- 1219access count
- Programming / programing language / Ruby
3
comment
(2008/05/27 04:16)
by tsukasaoishi
- 1clip
- 1716access count
- Programming / programing language / Ruby
0
comment
(2008/06/08 20:26)
by ugit
- 0clip
- 1829access count
- Programming / programing language / Ruby
2
comment
(2008/06/13 19:07)
by tsukasaoishi
- 0clip
- 1637access count
- Programming / programing language / Ruby
0
comment
(2009/11/18 21:37)
by marcy
- 0clip
- 1117access count
- Programming / programing language / Ruby
