findÊÇlinuxϺÜÇ¿´óµÄËÑË÷¹¤¾ß,µ«ËÙ¶ÈÂýÇҺܷÑÓ²ÅÌ¡£µ«²»¹ÜÔõô˵£¬´ËÃüÁîµÄʹÓÃƵÂÊÒÀÈ»ºÜ¸ß¡£
ʹÓÃÑ¡Ï
find [·¾¶] <±í´ïʽ> [²Ù×÷]
1¡¢nameÑ¡Ï°´Ãû³Æ²éÕÒ
²éÕÒµ±Ç°Ä¿Â¼ÏµÄmanage.py Îļþ£ºfind . -name ¡®manage.py¡¯
2¡¢atime/ctime/mtimeÑ¡Ï¸ù¾Ýʱ¼ä(24СʱΪµ¥Î»)²éÕÒ
×¢£ºa±íʾaccess£¬c±íʾcreate£¬m±íʾmodify
²éÕÒ24Сʱ֮ÄÚ´´½¨µÄÎļþ£º find . -ctime -1
²éÕÒ24Сʱ֮ǰ´´½¨µÄÎļþ£º find . -ctime 1
×¢£ºatimeºÍmtimeÓ÷¨Ò»ÖÂ
3¡¢amin/cmin/mminÑ¡Ï¸ù¾Ýʱ¼ä²éÕÒ
²éÕÒ10·ÖÖÓÖ®ÄÚ´´½¨µÄÎļþ£º find . -cmin -10
²éÕÒ10·ÖÖÓ֮ǰ´´½¨µÄÎļþ£º find . -cmin 10
×¢£ºaminºÍmminÓ÷¨Ò»ÖÂ
4¡¢anewer/cnewer/mnewer,²éÕÒ±ÈijһÎļþеÄÎļþ
²éÕÒÔÚhello.pyÖ®ºó·ÃÎʹýµÄÎļþ£ºfind . -anewer hello.py
5¡¢user
²éÕÒÊôÓÚijһÓû§µÄÎļþ£ºfind . -user the5fire
6¡¢type
²éÕÒËùÓÐÎļþ£ºfind . -type f
²éÕÒËùÓÐĿ¼°üº¬demoµÄĿ¼£ºfind . -type d -name ¡®*demo*¡¯
7¡¢exec,¾Ý˵ÊǺÜÇ¿´óµÄ²ÎÊý
²éÕÒ¡¯setup.py¡¯Îļþ£¬È»ºó´ò¿ª: find . -name ¡®setup.py¡¯ -exec vim {} \;
ÁíÍâÒ»¸ö×î³£ÓõÄ,Ç¿ÖÆɾ³ýÏîÄ¿ÏÂÃæµÄËùÓÐ.svnÎļþĿ¼£¬find . -name ¡®.svn¡¯ -exec rm -rf {} \;
8¡¢empty
ÏÔʾËùÓеĿհ×Îļþ£¬²¢ÏÔʾÏêϸ£ºfind . -empty -ls #¼ÓlsÍêÈ«»ÉßÌí×㣬ֻÊÇΪÁË˵Ã÷Õâ¸ö²ÎÊý¡£
9¡¢size
ÏÔʾ´óСΪ10kµÄÎļþ£ºfind . -size 10k
ÏÔʾËùÓдóÓÚ10kµÄÎļþ£ºfind . -size +10k
ÏÔʾËùÓÐСÓÚ10kµÄÎļþ£ºfind .-size -10k
10¡¢or¡¢and¡¢not£¬ »ò¡¢Óë¡¢·Ç²éѯ
²éÕÒ´óÓÚ10k»òÕßÃû³Æº¬ÓÐdemoµÄÎļþ£ºfind . -size +10k -o -name ¡®*demo*¡¯
²éÕÒ´óÓÚ10kÇÒСÓÚ100kµÄÎļþ£ºfind . -size +10k -a -size -100k
²éÕÒ´óÓÚ10k²¢ÇÒÃû³Æ²»º¬ÓÐdemoµÄÎļþ£ºfind . -size +10k ! -name ¡®*demo*¡¯
11¡¢perm£¬¸ù¾ÝÎļþȨÏÞ²éÕÒ
×¢£ºÈç²éÕÒȨÏÞΪ600µÄÎļþ£ºfind . -perm 600,Èç¹ûȨÏÞÇ°Ãæ¼Ó¡°-¡±ºÅ£¬±íʾÂú×ãһλƥÅä¼´¿É£¬
È磺find . -perm 007»áÆ¥ÅäȨÏÞΪ007¡¢077¡¢777µÄÎļþ
12¡¢regex£¬ÓÃÕýÔò±í´ïʽ²éÕÒ
Èç: find . -regex ¡®.*/[0-9]\w.*¡¯(Æ¥ÅäÒÔÊý×Ö¿ªÍ·µÄÎļþ)
13¡¢-maxdepth£¬ÏÞÖÆĿ¼Éî¶È²éÕÒ
²éÕÒÒ»¼¶Ä¿Â¼ÏµÄËùÓÐpyÎļþ£ºfind . -name ¡®*.py¡¯ -maxdepth 1
ÊäÈëfind -helpÖ®ºó»¹Óкܶ࣬¾Í²»Ò»Ò»ÁÐÁË£¬ÕâЩӦ¸ÃÄÜÂú×ãÈÕ³£ÐèÇóÁË¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ