|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:& o: E) \+ i" R# r
.tar
. [+ ?5 w2 C% X$ Z6 Q5 H5 K.gz3 U. g. E' Y8 P) J
.tar.gz
/ R6 l# g* E( J; `2 o' Q& v' z湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒
$ e Y+ }- L( _+ _' l0 l: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file
D, K! m! Q0 g9 I; U 1.)撠.tar.gz閫憯.tar% v' X4 G9 f! A8 V, o5 I4 C% s
gunzip filename.tar.gz3 d2 h: S1 ^& u% Q O9 r* N5 U
2.)湔.tar
. N, L% E, Z, C1 I: @- U8 \ tar -uvf filename.tar new_file ( [- B- g2 f4 |8 _" C% A. [' D, ^
tar -uvf filename.tar subdir/*
/ d9 Y+ \3 |! p( M2 _" m5 ~1 F 3.)憯蝮桀歇湔唳.tar
3 {! W6 b) I6 m/ x/ B" b- V gzip filename.tar
" J( _) }( D( D( I2 d- E+ i, S( D) | ^
支喳蝮桃桅瑼獢: 靘憒$ w/ b* i- {! M! ]
閬隞賜桅 aaa" c' u. j$ K( k3 H) {
銝唾隞賜 aaa 鋆⊿Y bbb 摮桅 4 Q1 Z* L1 Z4 U- t2 t, \
tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa
+ B7 _! Y5 N7 y9 J& g: N
: @- @% c t) `6 Q憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
, l+ ?# e/ L. _" M 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
1 m9 ^% ~7 }; O3 p/ J. c) N' E # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬
* ^, @9 ` T# z! T2 d% Y4 B# q # tar -ztvf tmp.tar.gz
' W: [3 R: C6 t$ V( \! s3 S$ ~ drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
`, [% L1 {! T9 } -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt0 { m9 }4 D3 u- n$ p1 Z
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
% C8 b0 r6 R3 R* Z- j- U # tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬5 P) M/ m3 i4 x* T& N# M0 j
# tar -ztvf tmp.tar.gz
$ ^" u* p# Z% o) B+ B7 {' W. u, c- ? drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./" n! O; G5 T! e1 w
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
( c: T" x& G/ P. v8 C -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
9 e: _( \. I7 N% k/ r 桀撌乩桅 /home/user1
) T s% B: n% n" k" s# d3 M8 W # tar -zcvf tmp.tar.gz tmp
" l! ?: \, v2 q! W; w6 Y l# Y # tar -ztvf tmp.tar.gz
4 n) I; o8 ` y/ t D drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
: k; L5 I: P1 _0 J7 p$ [) [ -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
L0 ~2 K( p5 i- {& N& h# j -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt* B( E F4 a8 o% X$ z
# tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬1 e' J) v! T, Z, [8 H1 a
# tar -ztvf tmp.tar.gz
7 @9 ]) v) d5 ^1 ]$ ?0 ]6 E drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./6 G* ^. {6 k f" a- e2 y* G; v3 M
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
6 O; S6 l+ q1 ]9 ~7 \ -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt. y7 B9 c& p3 d
, _ M+ F; C) C0 e
閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user18 l9 o0 m8 r( n3 D7 w; G6 e
# tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵8 G3 u2 G0 X$ z, a4 \
# tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
3 c5 h; N3 ~0 t 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬4 q8 v" B, |! v. k1 D2 T
.bz q1 Z( E' O7 y( J8 \1 i
.tar.bz
; f1 b8 R( U$ e% i" L. C.bz2
6 u1 `! r3 I6 O, i8 Q# @.tar.bz2" e f" w+ x" s: m- J9 {
.xz8 u# X2 z/ F/ @& |8 ]
.tar.xz
/ B4 G& Z. Q7 h. T! H- F/ P.Z
# a5 b* I% E' u: ~# l/ m- y.tar.Z- z3 s$ p0 \/ ]
.tgz
" _) j5 T2 f$ q+ D" i/ h.tar.tgz
4 G+ ?" ~: m2 K' ~0 V) ].7z
) f9 X' j7 M- p, s O.zip
& w, ?( K6 C+ S4 J0 [% D.rar1 Z ^/ Y2 \$ n$ R# U+ B3 p9 t2 K
.lha1 N) H" m& Z% T* U& G d2 B
3 [0 U" Q6 r* G- I5 Osplit : 憭扳脫撠瑼靘憒:
1 c7 |5 H& W7 a: S) Q" p6 W# y6 l銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞 5 u' ^0 l D2 w! o
split -b 50m file.tar.gz (m 臭誑寞G(giga))
- Q# S, s# q, K亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒: W; U- w7 Y7 v) C4 R
cat xaa xab xac xad xae xaf > file.tar.gz1 @: p1 Y( j( g% Z e7 l2 i
]2 W* b& ^6 f' V) ]
- Y+ c& L: C$ h' D4 M, ? : 9 ^ u# ~8 f5 E5 c
http://note.drx.tw/2008/04/command.html! J: u+ r' B# B
7 k. _9 R3 t& j8 L9 C
|
|
|