Ä¿ÇÇÇâÀÌ ³ª´Â *NIX
Ä¿ÇǴнº
½Ã½ºÅÛ/³×Æ®¿÷/º¸¾ÈÀ» ´Ù·ç´Â °÷
*
HanIRCÀÇ #coffeenix ¹æ
[
Àåºñ ¹× ȸ¼± ÈÄ¿ø
]
> Forum <
IT ÀÏÁ¤
N
e
w
!
ÀÚµ¿È ÇÁ·ÎÁ§Æ®
HOME
>
Unix/Linux óÀ½ ½ÃÀÛÇϱâ
>
¸í·É¾î »ç¿ëÇϱâ
µµ¿ò¸»
°Ë»ö :
»çÀÌÆ®
WHOIS
À¥¼¹ö Á¾·ù
find¸í·É¿¡¼ ƯÁ¤ µð·ºÅ丮 Á¦¿ÜÇÏ°í ã±â(exclude)
ÀÛ¼ºÀÏ : 2009/07/06 13:30
±Û¾´ÀÌ : ÁÁÀºÁøÈ£ (
http://coffeenix.net/
)
Á¶È¸¼ö : 34710
[
ÀÌÀüȸé
/
¼öÁ¤
] ºñ¹Ð¹øÈ£ :
Á¦ ¸ñ : find¸í·É¿¡¼ ƯÁ¤ µð·ºÅ丮 Á¦¿ÜÇÏ°í ã±â(exclude)
ÀÛ¼ºÀÚ : ÁÁÀºÁøÈ£(truefeel,
http://coffeenix.net/
)
ÀÛ¼ºÀÏ : 2009.7.3(±Ý)
find ¸í·ÉÀ» ÇÒ ¶§, ƯÁ¤ µð·ºÅ丮 Á¦¿ÜÇÏ°í findÇÏ´Â ¹æ¹ýÀº ¾ø´À³Ä°í ÁÖÀ§ºÐÀÌ ¹°¾î¿À¼Ì´Ù.
°³ÀÎÀûÀ¸·Î´Â find¿¡¼ ƯÁ¤ µð·ºÅ丮¸¦ excludeÇÏ´Â °Í ´ë½Å¿¡ µð·ºÅ丮¸¦ ³ª¿ÇÏ´Â ¹æ¹ýÀ» »ç¿ëÇß´Ù. ±×·¯³ª µð·ºÅ丮 °¹¼ö°¡ ¸¹°í, °°Àº depthÀÇ µð·ºÅ丮°¡ ¾Æ´Ï°í ÇÏÀ§ ƯÁ¤ µð·ºÅ丮 ¸î°³¸¦ excludeÇؾßÇÑ´Ù¸é? ¿É¼ÇÀ» È°¿ëÇÒ ¼ö ¹Û¿¡ ¾øÀ» °ÍÀÌ´Ù.
manÆäÀÌÁö¸¦ È®ÀÎÇغ¸´Ï -prune¿É¼ÇÀÌ ÀÖ´Ù. -prune ¿É¼ÇÀº ã¾Æ³½ °ÍÀÌ µð·ºÅ丮ÀÌ¸é ±× µð·ºÅ丮³»¿¡´Â findÇÏÁö ¾Ê´Â´Ù.
-name pattern
... »ý·« ...
To ignore a directory and the files under it, use -prune; see an example in the description of -wholename.
-prune
If -depth is not given, true; if the file is a directory, do not descend into it.
If -depth is given, false; no effect.
1. ¿¹Á¦·Î »ìÆ캸±â
[¿¹Á¦ 1] 2009°¡ Æ÷ÇÔµÈ ÆÄÀÏÀ» ã´Â´Ù. ´Ü ÆÄÀϸíÀÌ µð·ºÅ丮¿¡ ÇØ´çµÇ¸é ÇØ´ç µð·ºÅ丮 ÀÌÇϴ ãÁö ¾Ê´Â´Ù.
$
find
(Àüü º¸±â)
./
./check/check_list_2008_12.php
./check/check_list_2009_05.php
./check/check_list_2009_06.php
./2007_10_mobile
./2008_01_highlight
./2008_01_highlight/view.pl
./2008_01_highlight/view.sh
./2009_03_MSIE8
./2009_03_MSIE8/get_MSIE8.sh
./2009_05_apache
./2009_05_game
./2009_05_game/2009_05.log
$
find . -name "*2009*" -prune
./check/check_list_2009_05.php
./check/check_list_2009_06.php
./2009_03_MSIE8
./2009_05_apache
./2009_05_game
./2009_05_game/ µð·ºÅ丮 ÀÌÇÏ¿¡ 2009_05.log ÆÄÀÏÀÌ ÀÖÁö¸¸, -prune¿É¼ÇÀ¸·Î ÇØ´ç µð·ºÅ丮 ÀÌÇϴ ãÁö ¾Ê¾Ò´Ù.
[¿¹Á¦ 2] ./foo/bar µð·ºÅ丮´Â Á¦¿ÜÇÏ°í, *.txt ÆÄÀÏÀ» ã¾Æ¶ó.
$
find . ! \( -path './foo/bar' -prune \) -name "*.txt"
$
find . ! \( -type d -path './foo/bar' -prune \) -name "*.txt"
(º¸´Ù Á¤È®ÇÑ Ç¥Çö)
[¿¹Á¦ 3] ./foo/bar µð·ºÅ丮¿Í ./coffeenix/temp µð·ºÅ丮´Â Á¦¿ÜÇÏ°í, *.bak ÆÄÀÏÀ» ã¾Æ¶ó.
$
find . ! \( \( -path './foo/bar' -o -path './coffeenix/temp' \) -prune \) -name "*.bak"
$
find . ! \( \( -type d -path './foo/bar' -o -path './coffeenix/temp' \) -prune \) -name "*.bak"
(º¸´Ù Á¤È®ÇÑ Ç¥Çö)
[¿¹Á¦ 4] ./2008·Î ½ÃÀÛÇÏ´Â µð·ºÅ丮´Â Á¦¿ÜÇÏ°í, .*.bak ÆÄÀÏÀ» ã¾Æ¶ó.
$
find . ! \( -path './2008*' -prune \) -name "*.bak"
$
find . ! \( -type d -path './2008*' -prune \) -name "*.bak"
(º¸´Ù Á¤È®ÇÑ Ç¥Çö)
-path ´ë½Å -wholename ¿É¼ÇÀ» »ç¿ëÇصµ µÈ´Ù.
-path pattern
See -wholename. The predicate -path is also supported by HP-UX find.
-wholename pattern
File name matches shell pattern pattern. The metacharacters do not treat `/' or `.' specially; so, for example,
find . -wholename './sr*sc'
will print an entry for a directory called './src/misc' (if one exists). To ignore a whole directory tree, use -prune rather
than checking every file in the tree. For example, to skip the directory `src/emacs' and all files and directories under it,
and print the names of the other files found, do something like this:
find . -wholename './src/emacs' -prune -o -print
2. Âü°íÀÚ·á
* find manpage
http://unixhelp.ed.ac.uk/CGI/man-cgi?find
* À¯¿ëÇÑ find ¸í·É¾î ¿¹ ¸ðÀ½ (2003, ±Û ÁÁÀºÁøÈ£)
http://coffeenix.net/board_view.php?bd_code=36
Ä¿ÇǴнº Ä«Æä ÃÖ±Ù ±Û
[04/25]
±¹°¡
[04/24]
º¸Çè
[04/22]
Re: OpenSSL Ãë¾àÁ¡ Á¤¸®, Logjam(·Î±×Àë)¿¡¼ Heartbleed±îÁö
[04/21]
LET¡¯S START WITH ON
[04/21]
º¸Çè
[04/20]
Á¦ÁÖ
[04/20]
±¹³»
[04/19]
Á¦ÁÖ
[04/18]
??? ?????
[04/17]
???? onion ?????? -
[04/11]
±¹°¡
[04/10]
Stride Into Dream:
[03/20]
Re: ¿Â¶óÀΰÔÀÓÀÇ Á¾ÁÖ±¹ ´ëÇѹα¹
[10/20]
Cross Compiler ±ò
[07/14]
SSL ¬¡¬°
N
e
w
! ÃÖ±Ù¿¡ µî·ÏÇÑ ÆäÀÌÁö
KiCad EDA Suite project (Free/Libre/Open-Source EDA Suite) (CAD)
¿ÀÇÂij½ºÄÉÀ̵å ijµå (OpenCASCADE CAD)
QCad for Windows --- GNU GPL (Free Software)
The Hello World Collection
IPMI¸¦ È°¿ëÇÑ ¸®´ª½º ¼¹ö°ü¸®
DNS ¼³Á¤ °Ë»ç
nagiosgraph ¼³Ä¡ ¹æ¹ý
Slony-I ¼³Ä¡ ¹æ¹ý (postgresql replication tool)
Qmail±â¹ÝÀÇ Anti spam ½Ã½ºÅÛ ±¸ÃàÇϱâ
clusterssh
[ ÇÔ²²ÇÏ´Â »çÀÌÆ® ]
¿î¿µÁø :
ÁÁÀºÁøÈ£(truefeel)
, ¾ß¼ö(yasu), ¹ü³ÃÀÌ, sCag
2003³â 8¿ù 4ÀÏ~