|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:
. D8 G- I0 Z! L m4 T" N+ C.tar
7 O w r$ {$ h1 j, N( J5 K2 U.gz5 N6 C5 e' ]/ P: V6 `1 z
.tar.gz
/ g$ @3 g. {6 H. b0 T; B* S湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒( r7 R4 P3 `$ V( F
: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file
& |2 [6 G. A2 { 1.)撠.tar.gz閫憯.tar
+ j* W9 e% A* [* c: s0 s gunzip filename.tar.gz
% W3 R( t2 D+ I& m" v k 2.)湔.tar* z1 ^9 y. U4 e3 M5 ^
tar -uvf filename.tar new_file V. F( h2 K' k8 C( l s
tar -uvf filename.tar subdir/*
; m$ C$ x6 J. } N 3.)憯蝮桀歇湔唳.tar) X5 E. F( _! G
gzip filename.tar* Q( E: h! R( n7 f/ @2 m. I4 d G0 `
& \( H0 R+ ] h" j- r2 T7 I支喳蝮桃桅瑼獢: 靘憒
; C) \( {: P+ z) A k 閬隞賜桅 aaa, m! m6 V) i' ~8 k% y
銝唾隞賜 aaa 鋆⊿Y bbb 摮桅
4 z* a$ l" c; Q) b tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa
) u- y7 ^ p) t L2 o& R, z$ r/ ~1 d/ U
憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
( s' H& z" T& s+ p" X1 l& g& \ 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
: @6 `6 o ?- N* C2 Q' X/ x # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬
7 H7 u# L" [& ^ # tar -ztvf tmp.tar.gz , ]* D3 H! ~: x8 x* ?
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
( N5 q5 O) t. M9 h/ v, U -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
2 K! d' f0 X6 Y: k -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
6 W l* u8 v( g( ^ # tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬# }! ^, i) O: M; W1 _' f
# tar -ztvf tmp.tar.gz + m$ m$ z! m- C3 Z
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./( m! O! B, I" \( ?# A
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
0 Z k) M/ W& J( l# A+ z -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt4 p9 A: D! g+ P
桀撌乩桅 /home/user1
* U' b7 h; N& u b3 z# c8 s # tar -zcvf tmp.tar.gz tmp' v. [# n% |; k7 C
# tar -ztvf tmp.tar.gz
& n3 ]# ?4 P. L K$ }! ~7 g2 L drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
W2 P, T4 I- ] @4 x$ `. q5 ^ -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt! y- W. l) c2 A8 ~. N
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
( _5 g& s, ^+ ]$ I0 i # tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬
+ h; Q; s+ o4 d& Q) L # tar -ztvf tmp.tar.gz3 Q) }, m- d. }: ^
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
4 t: w P! a0 [7 J' Q9 s -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt; t2 h+ ] m8 t' I' W
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
. [3 D) e: {" x1 S2 b8 ]/ H7 H
4 X! U, `' N% g閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user1
) ?4 o0 u/ s6 O+ b* {) _ # tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵
! K! N! @! G( V8 d/ r # tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
4 i( a! i3 N3 D h- Z& { 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬
" \) `; \' `* R* @* A; w.bz& y8 I* o2 H- ? q, P
.tar.bz" l: m( R6 z' r: B) H' w; ?
.bz2: @) q+ _& S/ e
.tar.bz2
/ O M5 n) B1 A' _; m.xz+ R" a/ g0 h! ?+ B V9 @
.tar.xz) P6 x/ a/ s3 ?, q! F
.Z& N0 o! O, J- _/ g" i: |+ n
.tar.Z
$ ?' W" O" \% K% [6 T.tgz0 }# s& F, t F% j
.tar.tgz
9 ?* v1 R3 C) O& M. ?/ K' M2 K.7z {4 {6 k: ?& Y, g. u. g0 s
.zip W; h7 b+ H3 ~9 B0 A. C9 J
.rar
9 Q3 [# Q! L, ^7 l0 \& d* `. p.lha' {0 @6 D& A7 `# Q& J8 r4 S6 x
- |" c6 B/ ]% j3 A" _. X3 D
split : 憭扳脫撠瑼靘憒:
' x+ G, a, r5 @0 Q5 c$ J5 A7 y銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞
5 f i6 ^6 ]4 E! R( U# Rsplit -b 50m file.tar.gz (m 臭誑寞G(giga))
6 F7 M2 H& D( G( C亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:
- l2 f, g) J y: r4 Zcat xaa xab xac xad xae xaf > file.tar.gz5 o' m; J3 O" B* o7 Q
, C- g. K; f' g" n' Z
# P/ r1 x! O4 t7 I
: ' G" Y/ h6 s- f2 t0 V, k
http://note.drx.tw/2008/04/command.html
6 o& Y8 M! u& Y N- y% E: i/ P8 P% _" e
|
|
|