This file is README.txt ######################################### ## ## ½ºÅ©¸³Æ®¸í : renameto(ƯÁ¤ ÆÄÀÏ/µð·ºÅ丮¸¦ ¹Ù²Ù±â) ## ## ÀÛ¼ºÀÚ : ±èÄ¥ºÀ ## ÀÛ¼ºÀÏ : 2003.10.22 pathed for FreeBSD ## 2002.11.05 add upcase and lowcase, usage to stderr ## 2002.04.13 patch(sort) ## 2002.03.29 patch(thanks '´ÜnÅ°') ## 2002.03.27 add options ## 2002.03.04 ## ## ¶óÀ̼¾½º : GNU GPL ## ´Ù¿î·Îµå : http://www.linuxchannel.net/devel/renameto/ ## ## ########################################## ########################################## ## ## ## WARNING !!! ## ## »ç¿ëÀÚÀÇ »ç¿ë»ó ºÎÁÖÀÇ·Î ÀÎÇÑ ÇÇÇØ´Â ## ## ¾î¶°ÇÑ °æ¿ì¶ó°í º» ÀÛ¼ºÀÚ¿¡°Ô ±× Ã¥ÀÓ## ## ÀÌ ¾øÀ½À» ¹Ì¸® °øÁöÇÕ´Ï´Ù. ## ## ## ########################################## [±â´É] - ƯÁ¤ ¹®ÀÚ¿­ÀÇ ÆÄÀÏÀ» ã¾Æ¼­ ¹Ù²Þ - ƯÁ¤ ¹®ÀÚ¿­ÀÇ µð·ºÅ丮¸¦ ã¾Æ¼­ ¹Ù²Þ - ¹Ù²Ù±â Àü¿¡ view ±â´É Á¦°ø - ƯÁ¤ µð·ºÅ丮¿¡¼­ °Ë»ö°¡´É - ÇöÀçµð·ºÅ丮, ¸ðµç ¼­ºêµð·ºÅ丮, ƯÁ¤ ±íÀÌÀÇ µð·ºÅ丮 °Ë»ö - ´ë¼Ò¹®ÀÚ ¹Ù²Ù±â [»ç¿ë¹ý] # renameto --help usage : renameto [options] "/from_string/to_string/" "" options -R : include all sub directory (not default) -Rn : 'n' is sub directory maxdepth number '-R0' is current directory (same as not given options) -t,-test,--test : only test view -c,-case,--case : translate upcase and lowcase -v,-view,--view : only test view -d,-dir,--dir : only directory adjust (not files) -h,-help,--help : help example renameto /html/php/ "*.html" (same as rename command) renameto -R "/ /_/" "* *.mp3" (replace file " " to "_" all sub-directory) renameto -R -test "/ /_/" "* *.mp3" (test view) renameto -R -dir "/ /_/" "/home/xxx/mp3/* *" (replace directory) renameto -R -case "/[A-Z]/[a-z]/" "*" (to lowcase) renameto -R -case "/[e-k]/[E-K]/" "*" (to upcase) source download http://ftp.linuxchannel.net/devel/renameto/ # -R ÇÏÀ§ÀÇ ¸ðµç µð·ºÅ丮¿¡¼­ °Ë»ö -R0 ÇöÀç µð·ºÅ丮¿¡¼­¸¸ °Ë»ö -Rn ÇöÀçµð·ºÅ丮¿¡¼­ ±×´ÙÀ½ n´Ü°è µð·ºÅ丮±îÁö¸¸ °Ë»ö, nÀº ([0-9]*) -R ¿É¼ÇÀÌ ¾ø´Ù¸é ÇöÀçµð·ºÅ丮¿¡¼­ ¸¸ °Ë»ö -d, -dir, --d, --dir ÆÄÀÏ´ë½Å µð·ºÅ丮¿¡ Àû¿ë ÀÌ ¿É¼ÇÀÌ ¾ø´Ù¸é ±âº»ÀûÀ¸·Î ÆÄÀÏÀ» ±× ´ë»óÀ¸·Î ÇÔ -v, -view, --view, -t, -test, --test ÆÄÀÏÀ̳ª µð·ºÅ丮¸¦ ¹Ù²ÙÁö ¾Ê°í ±×³É ã¾Æ¼­ Ãâ·Â¸¸ ÇÔ(È®ÀÎÇÒ¶§) ÀÌ ¿É¼ÇÀÌ ¾ø´Ù¸é ¸ÅÄ¡µÇ´Â ÆÄÀÏÀ̳ª µð·ºÅ丮¸¦ ã¾Æ¼­ ¹Ù²Þ. -c, --case ´ë¹®ÀÚ->¼Ò¹®ÀÚ or ¼Ò¹®ÀÚ->´ë¹®ÀÚ '/from_string/to_string/' from_string -> to_string À¸·Î ±³Ã¼ °ø¹é ¹®ÀÚ¿­ÀÌ µé¾î°¥ ¼ö ÀÖÀ¸¹Ç·Î ¹Þµå½Ã Àüü¸¦ ' ³ª "·Î ¹­¾îÁÜ ¾çÀÚÀÇ ±¸ºÐÀÚ´Â / ·Î ±¸ºÐ 'ãÀ» µð·ºÅ丮³ª ÆÄÀÏ ´ë»ó' ¹Þµå½Ã Àüü¸¦ ' ³ª "·Î ¹­¾îÁÜ "* *" : °ø¹é ¹®ÀÚ¿­ÀÌ µé¾î°£ ¸ðµç ÆÄÀÏÀ̳ª µð·ºÅ丮 ´ë»ó "*" : ¸ðµç ÆÄÀÏÀ̳ª µð·ºÅ丮 ´ë»ó "*.mp3" : È®ÀåÀÚ(?)°¡ mp3ÀÎ ¸ðµç ÆÄÀÏ "*.[hH][tT][mM][lL]" : *.html *.HTML *.Html ... µî°ú ¸ÅÄ¡ "/home/*.php" : /home µð·ºÅ丮¸¦ ´ë»óÀ¸·Î *.php ÆÄÀÏ "home/*.php" : ÇöÀç µð·ºÅ丮¿¡¼­ »ó´ë °æ·Î°¡ home ÀÎ µð·ºÅ丮 [»ç¿ë¿¹ 1] /sdb1/mp3 µð·ºÅ丮 ¹× ±× ÇÏÀ§ ¸ðµç µð·ºÅ丮¿¡¼­ mp3 ÆÄÀÏÀ̳ª MP3 ÆÄÀÏÀ» ´ë»óÀ¸·Î ÆÄÀÏÀ̸§¿¡ °ø¹é(" ")ÀÌ µé¾î°¥ °æ¿ì "_" ·Î ¹Ù²Þ ¸ÕÀú Å×½ºÆ®ÇØ º½ $ renameto -R --test '/ /_/' '/sdb1/mp3/* *.[mM][pP]3' ... ... $ ¸®½ºÆ®°¡ ³ª¿À¸é --test ¿É¼ÇÀ» »©°í ½ÇÇàÇÔ $ renameto -R '/ /_/' '/sdb1/mp3/* *.[mM][pP]3' ... ... $ -R ´ë»óµð·ºÅ丮(/sdb1/mp3) ¹× ±× ÇÏÀ§ÀÇ ¸ðµç µð·ºÅ丮 Æ÷ÇÔ --test ´ÜÁö Å×½ºÆ®¸¸ Çغ½ '/ /_/' °ø¹éÀ» "_"À¸·Î ¹Ù²Ù±â '/sdb1/mp3/* *.[mM][pP]3' /sdb1/mp3/ ´Â ãÀ» µð·ºÅ丮ÀÇ ½Ã½ºÅÛ Àý´ë°æ·Î * *.[mM][pP]3 Àº °ø¹é ¹®ÀÚ¿­ÀÌ µé¾î°£ ÆÄÀÏÀÇ Ç¥Çö½Ä [»ç¿ë¿¹ 2] °ø¹é¹®ÀÚ ¾ø¾Ö±â $ renameto '/[ ]//' '*.mp3' ¶Ç´Â $ renameto '/ //' '*.mp3' Ư¼ö¹®ÀÚµé " ( ) * . ¾ø¾Ö±â $ renameto '/["()*.]//' '*.mp3' Ư¼ö¹®ÀÚµé [ ] ¾ø¾Ö±â $ renameto '/[][]//' '*.mp3' È®ÀåÀÚ ¹Ù²Ù±â $ renameto '/\.MP3$/.mp3/' '*.MP3' ÆÄÀÏÀ̸§ ¾Õ¿¡ 'My' ¹®ÀÚ¿­ Ãß°¡Çϱâ $ renameto '/^/My/' '*.mp3' ÆÄÀÏÀ̸§ ³¡¿¡ 'My' ¹®ÀÚ¿­ Ãß°¡Çϱâ $ renameto '/$/My/' '*.mp3' [»ç¿ë¿¹ 3] dot(.) ¹®ÀÚ ¾ø¾Ö±â Ʋ¸°¿¹ : $ renameto '/.//' '*' ¸Â´Â°æ¿ì : $ renameto '/[.]//' '*' ¶Ç´Â $ renameto '/\.//' '*' [»ç¿ë¿¹ 4] ´ë¼Ò¹®ÀÚ ¹Ù²Ù±â Ʋ¸°¿¹ : $ renameto '/[A-Z]/a-z/' '*' (-c ¿É¼ÇÀÌ ºüÁ®ÀÖÀ½) $ renameto '/[A-Z]/a-d/' '*' (¹®ÀÚŬ·¡½º ¹üÀ§°¡ ¸ÂÁú¾ÊÀ½) ´ë¹®ÀÚ -> ¼Ò¹®ÀÚ·Î ¹Ù²Ù±â $ renameto -c '/[A-Z]/a-z/' '*' or $ renameto -c '/[A-Z]/[a-z]/' '*' ¼Ò¹®ÀÚ -> ´ë¹®ÀÚ ¹Ù²Ù±â $ renameto -c '/[a-z]/A-Z/' '*' or $ renameto -c '/[a-z]/[A-Z]/' '*' ƯÁ¤ Ŭ·¡½º(E-K) ¾ËÆĺª¹®ÀÚ ¹Ù²Ù±â $ renameto -c '/[E-K]/e-k/' '*' $ renameto -c '/[e-k]/E-K/' '*' [»ç¿ë¿¹ 5] ¹®ÀÚŬ·¡½º ±×·ìÈ­ ¸ðµç ´ë¹®ÀÚ ´ÙÀ½¿¡ '_' ¹®ÀÚ Ãß°¡Çϱâ $ renameto '/\([A-Z]\)/\1_/' '*' ù¹ø° °ø¹é¿¡ '-' Ãß°¡Çϱâ $ renameto '/^\([^ ]\+\) /\1-/' '*' [»ç¿ë¿¹ 6] Á¾ÇÕ¿¹Á¦ : mp3 ÆÄÀÏ Á¤¸® $ ls 01 aaa.mp3 02 bbb (b1).mp3 03 ccc Abcd efg.MP3 04 ddd bdefgg DDD.mp3 05 eee kkk.MP3 ... À§¿Í °°Àº Çü½ÄÀ» ÃëÇÏ´Â ¿©·¯°³ÀÇ ÆÄÀϵéÀ» artist-[00]-aaa_bbb_ccc.mp3 ÀÌ¿Í°°ÀÌ Çü½ÄÀ¸·Î ¹Ù²Ù·Á¸é(´ë¹®ÀÚ->¼Ò¹®ÀÚ), 1. ´ë¹®ÀÚ¸¦ ¸ðµÎ ¼Ò¹®ÀÚ·Î ¹Ù²Ù±â $ renameto -c '/[A-Z]/a-z/' '*.[mM][pP]3' 2. ù¹ø° °ø¹éÀ» ']-' ¹®ÀÚ·Î ¹Ù²Ù±â(±×·ìÈ­ »ç¿ë) $ renameto '/^\([^ ]\+\) /\1]-/' '*.mp3' 3. ¸ðµç ÆÄÀϾտ¡ 'artist-[' ¹®ÀÚ Ãß°¡ $ renameto '/^/artist-[' '*' 4. ³ª¸ÓÁö ¸ðµç °ø¹éÀ» '_'·Î ¹Ù²Ù±â $ renameto '/[ ]/_/' '*' 5. Ư¼ö¹®ÀÚ °ýÈ£ (, )¸¦ ¾ø¾Ö±â(ÇÊ¿äÇÏ´Ù¸é) $ renameto '/[()]//' '*' 6. È®ÀÎ $ ls artist-[01]-aaa.mp3 artist-[02]-bbb_b1.mp3 artist-[03]-ccc_abcd_efg.mp3 artist-[04]-ddd_bdefgg_ddd.mp3 artist-[05]-eeekkk.mp3 ... *ÁÖÀÇ) °¡´ÉÇÑ Æ¯¼ö¹®ÀÚ´Â [¿Í ]»çÀÌ¿¡ ³Ö¾î¼­ Å×½ºÆ®(-t, --test)¸¦ ÇÑ ´ÙÀ½¿¡ ½ÇÇà Çϼ¼¿ä. ---------------------------------------------