»ç¼ö¸¶      2002/11/01 05:13:06     11305     0   
   tar (¹é¾÷Çϱâ)
http://thinkit.or.kr/linux_s/ÀÇ ¾È¹Î±â´ÔÀÌ ÀÛ¼ºÇϽŠ±ÛÀ» °¡Á®´Ù ¿Ã¸³´Ï´Ù..
ÀÛÀº µµ¿òÀ̳ª¸¶ µÇ¼ÌÀ¸¸é ÇÕ´Ï´Ù.


tar (¹é¾÷Çϱâ)

¾ÆÄ«À̺ê(archive)·Î ¸¸µé¾î¼­ ¹é¾÷ÇÒ ¶§ »ç¿ëÇÏ´Â ¸í·É¾îÀÌ´Ù. ÀÌ ¶§¿¡´Â ¾ÐÃàÀº ÇÏÁö ¾Ê°í, ¹­±â¸¸ ÇÑ´Ù. ¿Ö³ÄÇϸé, ¾ÐÃàÀº ÀϺΠ¼Õ»óÀÌ »ý±â´õ¶óµµfile Àüü¸¦ »ì¸± ¼ö°¡ ¾ø±â ¶§¹®ÀÌ´Ù.
¾î¶² fileµéÀ» ¾ÐÃàÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó, ¹­¾îÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù. ±× ¾È¿¡ ÀÖ´Â ¾ÐÃà ¿É¼ÇÀ» »ç¿ëÇؼ­ ¾ÐÃàÀ» ÇÒ ¼ö ÀÖ´Ù.

ÁÖ¿ä ¿É¼Ç
¨ç c : create. file »õ·Î »ý¼º
¨è v : ¹­ÀÏ ´ë»ó fileÀ̳ª directory¸¦ È­¸é¿¡ º¸¿©ÁØ´Ù.
¨é f : archive file¸íÀ» ÁöÁ¤ÇÒ ¶§ ¹Ýµå½Ã »ç¿ë
¨ê x : extract. ¹­Àº °ÍÀ» ÇØÁ¦ÇÒ ¶§
¨ë z : gzipÀ¸·Î ¾ÐÃà/ÇØÁ¦¸¦ ÀÌ¿ëÇÑ´Ù.
¨ì t : tar³ª tar.gz¿¡ µé¾îÀÖ´Â ³»¿ëÀ» È®ÀÎ
¨í j : bzip2À¸·Î ¾ÐÃà/ÇØÁ¦¸¦ ÀÌ¿ëÇÑ´Ù.
¨î Z : compress¿Í °ü·ÃµÈ ¾ÐÃ༳Á¤ ¹× ÇØÁ¦¿¡ »ç¿ë
¨ï r : ¹­ÀÎ file ¾È¿¡ ¶Ç ´Ù¸¥ file Ãß°¡
¨ð u : ¾ÆÄ«À̺êÀÇ ¾÷µ¥ÀÌÆ®

¿¹Á¦)
[root@localho.t /root]# tar cvf mk.tar tar_test  
/* tar_test directory¿¡ ÀÖ´Â fileµéÀ» mk.tar·Î ¹­±â */
tar_test/
tar_test/lilo.conf
tar_test/inittab
tar_test/fstab

[root@localho.t /root]#tar tvf mk.tar                /* tarÀÇ ³»¿ëÀ» º¸±â */
[root@localho.t /root]#rm -rf tar_test/              /* ¿øº»ÀÎ tar_test directory »èÁ¦ */
[root@localho.t /root]#tar xvf mk.tar                /* mk.tar¸¦ Ç®¾îÁØ´Ù.  */
tar_test/           ¡æ directory°¡ ¸ÕÀú »ì¾Æ³ª°í,
tar_test/lilo.conf  ¡æ ³ª¸ÓÁö fileµéµµ ¿ø·¡ À§Ä¡´ë·Î °£´Ù.
tar_test/inittab
tar_test/fstab

[root@localho.t /root]#tar cvfz mk.tar.gz tar_test  
/* fileµéÀ» ¹­À¸¸é¼­ gzipÀ¸·Î ÆÄÀÏ ¾ÐÃàÇÔ. */
tar_test/                                  ¹Ýµå½Ã gz±îÁö ºÙ¿©¼­ file¸íÀ» ÁÖµµ·Ï ÇÑ´Ù.
tar_test/lilo.conf                         »ó´ë¹æµµ ¾ÐÃàÀÓÀ» ¾Ë°í z ¿É¼ÇÀ» »ç¿ëÇÏ°ÚÁÒ. ^^
tar_test/inittab
tar_test/fstab
tar_test/termcap

[root@localho.t /root]#ls -l mk.tar*      /*  ¹­ÀÎ file°ú ¾ÐÃà±îÁö ÇÑ fileÀÇ ¿ë·®À» ºñ±³ */
-rw-r--r-- 1 root root 737280 1¿ù 16 11:44  mk.tar     ¡æ ±×³É ¹­Àº °Í
-rw-r--r-- 1 root root 236758 1¿ù 16 11:43  mk.tar.gz  ¡æ gzipÀ¸·Î ¾ÐÃàÇÑ°Í

[root@localho.t /root]#tar xvfz mk.tar.gz            /* ¾ÐÃà Ç®±â */
[root@localho.t /root]#tar xvfz mk.tar.gz -C /home/mk  ©£ /home/mk(´Ù¸¥ directory)¿¡ ¾ÐÃàÇ®±â


µÎ´Ü°è·Î ¾ÐÃàÇϱâ(tar cvf·Î ¹­Àº µÚ gzip, compress³ª bzip2·Î ¾ÐÃà)


¢À gzip ÀÌ¿ë
[root@localho.t /root]# tar cvf mk.tar tar_test  
[root@localho.t /root]# gzip mk.tar   /* gzipÀ¸·Î ¾ÐÃàÇϱâ. mk.tar.gz¶ó´Â fileÀÌ »ý¼ºµÈ´Ù */
[root@localho.t /root]# rm -rf ter_test
[root@localho.t /root]# gzip -d mk.tar.gz  /* ¾ÐÃà Ç®±â. gzip -d¸¦ gunzip ÀÌ¿ëÇصµ µÈ´Ù.. */


¢À bzip2 ÀÌ¿ë
[root@localho.t /root]# bzip2 mk.tar        /* bzip2·Î ¾ÐÃàÇϱ⠠mk.tar.bz2¶ó´Â fileÀÌ »ý¼ºµÈ´Ù. */
[root@localho.t /root]# bzip2 -d mk.tar.bz2  /* bzip2 -d¸¦ bunzip2·Î ½áµµ µÈ´Ù. */
ÇÑ ¹ø¿¡ ¾ÐÃà°ú ¹­ÀÎ °ÍÀ» ´Ù Ç®±â
[root@localho.t /root]# tar xvfj mk.tar.bz2



¢À compress ÀÌ¿ë
[root@localho.t /root]# compress mk.tar    
/* compress·Î ¾ÐÃàÇϱ⠠mk.tar.Z ¶ó´Â fileÀÌ »ý¼ºµÈ´Ù. */
[root@localho.t /root]# uncompress mk.tar.Z
ÇÑ ¹ø¿¡ ¾ÐÃà°ú ¹­ÀÎ °ÍÀ» ´Ù Ç®±â
[root@localho.t /root]# tar xvfZ mk.tar.Z


[Á¤¸®] ¾ÐÃàµÈ ¾ÆÄ«ÀÌºê ¸¸µå´Â ¹ý
[root@localho.t /root]# tar cvf mk.tar tar_test/
[root@localho.t /root]# gzip  mk.tar
-> [root@localho.t /root]# tar cvfz  mk.tar.gz  tar_test/    /* Çѹø¿¡ ¾ÐÃàÇϱâ */


[root@localho.t /root]# tar cvf mk.tar tar_test/
[root@localho.t /root]# bzip2 mk.tar
-> [root@localho.t /root]# tar cvfj mk.tar.bz2 tar_test/     /* Çѹø¿¡ ¾ÐÃàÇϱâ */


[root@localho.t /root]# tar cvf mk.tar tar_test/
[root@localho.t /root]# compress mk.tar
-> [root@localho.t /root]# tar cvfZ mk.tar.Z tar_test/       /* Çѹø¿¡ ¾ÐÃàÇϱâ */


¾ÐÃà ÇØÁ¦ Çϴ¹ý
[root@localho.t /root]# gzip -d mk.tar.gz
[root@localho.t /root]# tar xvf mk.tar
-> [root@localho.t /root]# tar xvfz mk.tar.gz            /* Çѹø¿¡ Ç®±â */


[root@localho.t /root]# bzip2 -d mk.tar.bz2
[root@localho.t /root]# tar xvf mk.tar
-> [root@localho.t /root]# tar xvfj mk.tar.bz2           /* Çѹø¿¡ Ç®±â */


[root@localho.t /root]# uncompress mk.tar.Z
[root@localho.t /root]# tar xvf mk.tar
-> [root@localho.t /root]# tar xvfZ mk.tar.Z           /* Çѹø¿¡ Ç®±â */

¢À tar¿¡ file Ãß°¡ ¹× ¼öÁ¤ Çϱâ

[root@localho.t /root]# tar rvf mk.tar cat_test  /* cat_test¶ó´Â fileÀ» ¾ÆÄ«À̺ê¼Ó¿¡ Ãß°¡ */
cat_test
[root@localho.t /root]# tar tvf mk.tar        /* Ãß°¡ µÇ¾ú´ÂÁö ¸ñ·Ï È®ÀÎ */


[root@localho.t /root]# cp /etc/resolv.conf tar_test/  
/* mk.tarÀÇ ¿øº»ÀÎ tar_test directory¿¡ file º¹»ç */
[root@localho.t /root]# tar uvf mk.tar tar_test  
/* tar_testÀÇ ³»¿ë°ú mk.tarÀÇ ³»¿ëÀ» ºñ±³ÇÏ¿© ´Þ¶óÁø tar_test/resolv.conf °ÍÀÌ ÀÖÀ¸¸é updateÇÏ°í, ¸ñ·ÏÀ» º¸¿©ÁØ´Ù. */



¢À ¾ÆÄ«ÀÌºê ¼ÓÀÇ Æ¯Á¤ÆÄÀÏ »èÁ¦
[root@localho.t /root]# tar --list --file=collection.tar
blues
folk
jazz
rock

[root@localho.t /root]# tar --delete --file=collection.tar blues

[root@localho.t /root]# tar --list --file=collection.tar
folk
jazz
rock


¢À ¾ÆÄ«ÀÌºê ¼ÓÀÇ Æ¯Á¤ÇÑ ÆÄÀϸ¸ Ç®±â
[root@localho.t /root]# tar --extract --file=collection.tar blues
[Âü°í] : http:///mmlab.ce.cnu.ac.kr/ftp/pub/gnu/Manuals/tar-1.12/html_node/tar_58.html
  

   
ÄÚ¸àÆ®¸¦ ÀÛ¼ºÇϽøé 2 Æ÷ÀÎÆ®°¡ Áö±ÞµË´Ï´Ù.

       

184 ÀÎÅÍ³Ý °Ë»öÇÒ¶§ Çѹ濡 ÆíÇÏ°Ô Çϼ¼¿ä ^^ ¸·µ¥¹«½Î 05/30 11396
111 [linux]  ¸ðÁú¶ó¿¡¼­ µ¿¿µ»óº¸±â »ç¼ö¸¶ 11/22 11381
33 < À¥µðÀÚÀ̳ʷΠ¼ºÀåÇϱâ À§ÇÑ ¸î°¡Áö Á¶¾ðµé... [3] with 01/12 11346 02/04(10:48)
199 À¯¸®Ã¢ÀÇ Âîµç ¶§´Â ·¦À¸·Î [1] ¸·µ¥¹«½Î 06/04 11314 11/10(20:37)
>> tar (¹é¾÷Çϱâ) »ç¼ö¸¶ 11/01 11305
29 ÃֱٰԽù° ÃßÃâ... [8] r00ry 01/04 11305 02/27(18:13)
278 ¼îÇθôâ¾÷ : ¼îÇθôÁ¦ÀÛ±âȹ [2] Á¤Àξƺü 12/09 11302 05/21(10:48)
124 ÀÚ±âȨÆäÀÌÁö¿¡ ¹è°æÀ½¾Ç ±ò±â [4] 12/20 11265 12/21(23:26)
194 ºñµëÀ» ¾ø¾Ö´Â ½¬¿î ¹æ¹ý ¸·µ¥¹«½Î 06/04 11262
53 COMPUZ.com ¿¡ äÆÃÀ» ¼³Ä¡ÇÏÀÚ!! 03/03 11249
139 Àý´ë°æ·Î ¾Ë¾Æ³»±â 01/13 11248
108 »çÁøÀ» »Ç»þ½Ã »çÁø»¡ ¸¸µé¾îº¸ÀÚ! [2] 11/17 11247 09/15(22:15)
185 ÁÁÀº ºñ´©¸¦ °í¸£´Â ¹æ¹ý ¸·µ¥¹«½Î 05/30 11239
177 ÄÄÇ»Å͸¦ ÄÑ°í ³ª¼­ ³Ê¹« ¿À·¡±â´Ù¸±¶§... ¹Ì¾ß¿ì 02/25 11233
259 ¹®ÀÚµðÀÚÀÎ2 movengroove 08/18 11200
FIRST512131415161718LAST