$ find ÆÄÀϸí
find ---ÁÖ¾îÁø ÆÄÀϸí°ú µ¿ÀÏÇÑ ÆÄÀÏÀ» ã°í, ±× °æ·Î¸¦ Ãâ·ÂÇÑ´Ù.
# find / -name ÆÄÀϸí -print
ÃÖ»óÀ§ ·çÆ® µð·ºÅ丮ºÎÅÍ °Ë»öÇÏ¿© °Ë»öµÈ ÆÄÀÏÀ» ÇÑ Çà¿¡ Çϳª¾¿ Ç¥ÁØ Ãâ·Â
# find . -name ÆÄÀϸí -print
ÇöÁ¦ÀÇ ÀÛ¾÷ µð·ºÅ丮¿¡¼ °Ë»ö
# find / -size +1000 -print
ÃÖ»óÀ§ ·çÆ®¿¡¼ Å©±â°¡ 1000ºí·Ï ÀÌ»óÀÎ ÆÄÀÏ °Ë»ö
# find . -size -1000 -print
Çö µð·ºÅ丮¿¡¼ Å©±â°¡ 1000ºí·Ï ÀÌÇÏÀÎ ÆÄÀÏ °Ë»ö
# find . -mtime +10 -print
10ÀÏ ÀÌÀü¿¡ ¼öÁ¤µÈ ÆÄÀÏ °Ë»ö
# find . -mtime -10 exec rm {} :
10ÀÏ À̳»¿¡ ¼öÁ¤ÇÑ ÆÄÀÏÀ» °Ë»öÇÏ¿© ¸ðµÎ Áö¿î´Ù
# find / -cmin 5 -print
5ºÐÀü¿¡ ¸¶Áö¸·À¸·Î ¼öÁ¤µÈ ÆÄÀÏÀ» ãÀ» ¼ö ÀÖ´Ù.
# find /home -empty -print
/home µð·ºÅ丮¿¡ ¿ë·®ÀÌ 0ÀÎ ÆÄÀÏ°ú µð·ºÅ丮¸¦ ã´Â´Ù.
# find / -perm -4000 -print
Æ۹̼ÇÀÌ 4000 ÀÌ»óÀÎ ÆÄÀÏÀ» ¸ðµÎ Ãâ·ÂÇÑ´Ù.
Ãâó :
http://www.linuxno1.com/ find ./ -name "*.jsp" -exec grep "request" {} ; -print
µð·ºÅ丮³»¿¡(ÇÏÀ§µð·ºÅ丮Æ÷ÇÔ) *.jsp¶ó´Â ÆÄÀϾȿ¡ request¶ó´Â ´Ü¾î°¡ ÀÖ´Â Áö ã¾Æ¼ »Ñ·ÁÁÝ´Ï´Ù.
find ./ -name "*.jsp" -exec perl -pi -e "s/search/replace/g" {} ; -print
µð·ºÅ丮³»¿¡ *.jsp¶ó´Â ÆÄÀϸíÀ» °¡Áø ÆÄÀÏÀ» ã°í ±× ¾È¿¡ search¶ó´Â ´Ü¾î°¡ Æ÷ÇԵǾî ÀÖÀ»°æ¿ì, replace·Î ¼öÁ¤ÇÕ´Ï´Ù.
¹®ÀÚ¿¾È¿¡ " ÀÌ µé¾î°¥ °æ¿ì x22·Î ½áÁÝ´Ï´Ù.
find ./ -mtime 0
24½Ã°£ ³»¿¡ ¼öÁ¤µÈ ÆÄÀÏÀ» »Ñ·ÁÁÝ´Ï´Ù.
¾Æ½±°Ôµµ Ãâ·ÂµÇ´Â °Í¿¡ ´ëÇÑ Á¦¾î´Â Àß ¸ð¸£°Ú½À´Ï´Ù. ¤Ñ.¤Ñ;
ƯÁ¤ ¿ë·® ÀÌ»óÀÇ ÆÄÀÏÀ» ã°í ½ÍÀ»¶§
find /home/ -size +2000000
ƯÁ¤ È®ÀåÀÚÀÇ ÆÄÀÏÀ» ã°í ÀÚµ¿À¸·Î Áö¿ì°í ½ÍÀ»¶§
find /home/ -name *.asf -exec rm -rf {} ;
ÆÛ¹Ì¼Ç 706ÀÎ µð·ºÅ丮¸¦ Â÷ÀÚ¼ 707·Î º¯È¯
find /home/ -perm 706 -type d -exec chmod 707 {} ;
chmod 707 `find -perm 706`
»ç¿ëÀÚ °èÁ¤¿¡¼ ȯ°æ¼³Á¤ ÆÄÀÏ °Ë»öÇß³ª È®ÀÎ
find /home/ -maxdepth 2 -name .bash_history -exec grep -H .conf {} ; |
less
3ÀÏ À̳» µ¿¾È ¼öÁ¤µÈ ÆÄÀÏ È®ÀÎ
find /home/ -mtime -3
3½Ã°£ À̳» µ¿¾È ¼öÁ¤µÈ ÆÄÀÏ È®ÀÎ
find /home/ -mmin -3
¼öÁ¤µÈÁö 3½Ã°£ ÀÌÈÄµÈ ÆÄÀÏ
find /home/ -mmin +3
ÇöÀçÆú´õ¿¡¼ ¼öÁ¤µÈÁö 1½Ã°£ À̳»ÀÇ ÆÄÀϵ鸸 ¾ÐÃà
tar cvzf filename.tgz $( find ./ -type f -mmin -60 )
Ãâó :http://www.happyjung.com/gnuboard/bbs/board.php?bo_table=lecture&wr_id=244&sca=%B8%AE%B4%AA%BD%BA