|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:
3 ?" a& ?- n& ?3 k.tar5 ]* z1 h/ |& g5 [& Q5 c
.gz
$ ?( y- \' ^. d$ o8 I" Y. ~.tar.gz - c; c& Z- _( q1 u; ]% O! b8 O
湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒0 @" F$ v/ b' J
: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file' z$ a+ V) ~1 h# z
1.)撠.tar.gz閫憯.tar
! L6 r( k6 a1 y/ c gunzip filename.tar.gz1 H; b- D- N8 n
2.)湔.tar6 p! g5 ?$ }2 l$ {8 v6 r- U
tar -uvf filename.tar new_file
/ E, e1 \, f& m) ]5 j1 O tar -uvf filename.tar subdir/*8 [6 b9 Q3 _! B* w
3.)憯蝮桀歇湔唳.tar/ t8 H6 {" F! N! o( e
gzip filename.tar
, E- K8 H9 ^ p! I" P7 n
4 @$ V- X! `# `, j( A; c支喳蝮桃桅瑼獢: 靘憒* r$ A8 k# U: \" S" T( O) @/ }
閬隞賜桅 aaa
. Y- t, Z- R# n6 {) D( Y+ P5 x9 H 銝唾隞賜 aaa 鋆⊿Y bbb 摮桅 3 o7 ^3 o) \; N5 x9 f
tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa7 V3 r. C& ?2 h/ {% _1 O
2 A; _6 Q+ r" z+ U
憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
; C& v4 J$ ?6 ~& I/ g 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
8 }0 ?3 K# a& v # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬
; \! C( o: X9 N( I # tar -ztvf tmp.tar.gz
# D( a/ `- V% y% S' s3 w drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/& s9 Y4 `1 H$ j2 o: V2 [$ @4 [
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
2 `' B5 R5 P6 z0 ~2 t. W1 y -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt# e* x( \1 Q" p0 Z6 ]/ p
# tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬9 W, N- W7 I$ X3 ~! C
# tar -ztvf tmp.tar.gz
' ]$ L3 ]0 J" r drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
~; i: `6 j" l$ }7 ~ -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
* ?: Y: ?! |1 ?* [8 x; U -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt3 J- J. ^& k7 D# L5 T! }2 J
桀撌乩桅 /home/user16 A) L' I- Z& o2 O) P3 Z0 K. T+ r
# tar -zcvf tmp.tar.gz tmp
& }% g5 C; s4 e; E0 K& w# T& Y L # tar -ztvf tmp.tar.gz
5 Q1 K% {) j* L drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
: x- K8 h5 j2 Y# Q( e -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt& }; R6 w, x" q0 t6 G9 I i
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt# K% `/ s% g9 P. _ ~* \: U) s }
# tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬# d5 B0 O" b/ P* S/ X
# tar -ztvf tmp.tar.gz
# N; u) ?3 H: u Y/ s drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
( S u% Y- R( v& `& L9 @. u; H -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt8 r$ _# M* O; V( ~
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt8 f0 d3 e9 f: X, h+ D5 X
. L! ~3 _" T& w9 k; Z: x$ x+ x
閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user1
) L# Y0 A% Y8 \6 J1 j # tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵5 N& }! K, x$ Z8 k
# tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
( e# ]# H% k6 K# I1 m 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬
+ a" F: I& g9 b8 x0 Z.bz' b) x+ G: G2 X7 s( p' A! B
.tar.bz, A# Q6 T- |# u! V& x8 U1 F
.bz2
$ y* }7 f6 q5 V.tar.bz24 B6 \6 H s1 M4 |/ b' G9 w. J
.xz
/ \% a8 m0 m/ K* z0 p0 L) e( _.tar.xz6 G( I1 P1 @0 `5 O! |' ?
.Z0 {, i4 i2 [- s) f5 n$ t4 b& w5 J
.tar.Z2 R; e7 n' T7 n( x7 q/ Z
.tgz
: S1 ?1 z. _8 F# k2 i.tar.tgz
' {( E- p6 R7 c.7z9 f1 W3 m) f/ J9 }& E# C
.zip
6 d1 X! t1 d1 r5 z+ R7 x.rar
+ r, {4 p: }! j$ w.lha
4 v" N9 g% t9 C( |0 r
" y" h( Y* U" R% {7 q' Qsplit : 憭扳脫撠瑼靘憒:: d# P# h: |) q* K7 m, c
銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞
6 g6 o2 I6 P0 S: Dsplit -b 50m file.tar.gz (m 臭誑寞G(giga))* I: ]+ Z4 P6 b2 g( k- F
亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:$ T- A/ F+ D& E. s. a% d
cat xaa xab xac xad xae xaf > file.tar.gz, d. J g1 x/ m; N5 Q
" Q0 m0 k! W1 o0 G
+ j. N9 Y) T4 F H# v/ q" _
:
+ A4 u% B/ w0 ^0 Xhttp://note.drx.tw/2008/04/command.html
) C R g6 u1 ~( C5 J# N9 z3 N1 L, P. a$ @& o6 _; B, {
|
|
|