°Ô½Ã¹° 42°Ç
   
¸®´ª½º find ¸í·É¾î ¿¹Á¦ [ gid / uid ]
±Û¾´ÀÌ : theko ³¯Â¥ : 2011-08-30 (È­) 15:36 Á¶È¸ : 3456

$ 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

theko 2012-01-14 (Åä) 11:56

find /usr/sap/tmp/  -gid 1005 -print

find / -uid 2004  -exec chown 1200 {} \;

===============================

find / -gid 1005  -exec chown -h .1001 {} \;

find / -gid 1005  -exec chgrp -h  1001 {} \;

 ÀÌ µÎ°¡Áö´Â °á°ú´Â °ªÀº °á°ú´Ù ´Ü chown À¸·Î ÇÒ¶§ . À» ¹«Á¶°Ç Âï¾îÁà¾ß GID°¡ º¯°æ

 ¸¸¾à . À» ¾È Âï¾îÁÖ¸é uid °¡ º¯°æµÈ´Ù.

===============================


theko 2013-07-10 (¼ö) 14:01
find ./ -mtime +910 -exec rm -rf {} \;

ÇöÀç·Î ºÎÅÍ 910ÀÏ ÀÌÀü ÀÚ·á »èÁ¦Çϱâ

find ./ -mtime +910

ÇöÀç·Î ºÎÅÍ 910ÀÏ ÀÌÀü ÆÄÀÏ Ã£±â
À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com