|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:, s& |" v& O* p+ \9 X( c- J: `
.tar# m3 f( w8 h# I& t1 I; X
.gz# y4 ]9 n6 @: |) G# p
.tar.gz ; I* Y# o+ h* R9 a: g2 z8 U+ F
湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒
7 K6 h! I- s0 j' X& p- x6 D/ x$ x: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file
9 }$ P0 n* D( ~ 1.)撠.tar.gz閫憯.tar- o% ~" b/ U* n, F7 c% ~& O9 t" c
gunzip filename.tar.gz
3 [ B8 F9 \9 F3 a6 @/ J 2.)湔.tar& O% G p* P5 a) i! V
tar -uvf filename.tar new_file
6 I( c5 d, j0 |" g- i9 o tar -uvf filename.tar subdir/*
0 { h4 ^5 L5 `! Q6 O& L 3.)憯蝮桀歇湔唳.tar
' o2 f- R# ?9 D4 ~; S gzip filename.tar- {# o, U) U& U E0 ^
% G% M9 Z. b; p支喳蝮桃桅瑼獢: 靘憒
1 D* j6 e5 h, H$ k+ r1 @! L 閬隞賜桅 aaa e5 X/ J1 u4 s- G7 e$ u
銝唾隞賜 aaa 鋆⊿Y bbb 摮桅 ( R1 r4 Q4 d, ]- {5 s+ L
tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa/ e- X2 u! J; H4 g5 `. A: |/ Z
5 k9 Z) C8 `7 A憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
; P, ?$ _4 k0 u0 n5 c0 B' e' g1 w 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
8 t5 p8 P% }/ m7 ? l # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬7 p/ l- O' K5 f! o! n# L
# tar -ztvf tmp.tar.gz
2 x' {% b% ^& p$ h5 h) k" C, @ Y drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/4 m& `& g. v9 Q+ w E1 x
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
# G5 W# Y1 I2 T5 ?7 v ~ z2 K* g* w3 p -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
4 P" n4 d" g7 a4 N # tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬
) z$ |& A8 ~8 M' m5 o) K # tar -ztvf tmp.tar.gz " g. O! w7 I4 [
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./- ?7 q1 }: F4 z' G) ?! C! l
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt( |$ [/ k: G. G. T8 U7 i
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
: H7 f# |4 n/ `! p2 { }- d$ i 桀撌乩桅 /home/user1
* I8 V" u2 U0 I; e+ F% m% U # tar -zcvf tmp.tar.gz tmp# G, }* B# u2 G5 j
# tar -ztvf tmp.tar.gz9 b4 f5 X4 l3 Y& B6 n2 o2 o
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
) s- l0 j; t) |& V0 Z -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
q" f7 t2 l) p4 _" k5 C N -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
) L. o: ~2 k \4 J9 U1 J: u # tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬* ^+ n& M- p$ H# ?, @5 C
# tar -ztvf tmp.tar.gz! g2 Z/ |! U( u8 c9 n) t6 p
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./: [ N4 A, G7 _
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
# R* O1 T& ` `% b# G& X! x -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt$ M( |- {# x; r3 g" m
6 Q, T0 I/ v+ [+ r4 L7 r
閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user11 m$ T3 a+ Y) s) f0 I
# tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵# m) q8 o+ _! [' J
# tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
% r! j7 D1 n6 }; p: A 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬
; y$ ` S5 s# ]7 Q" t# s.bz
( v2 H0 f% k8 O9 F4 N.tar.bz9 i3 y* u1 z/ s6 |, z- n, L. A9 e( }, c
.bz26 n. ~1 O& p# ^4 b8 ]1 E# ~
.tar.bz2
& L6 n) ^0 s, C$ U# ~/ Y+ I.xz/ P4 f3 ]* d* a+ I2 W
.tar.xz" y& N6 O' o$ l* Z7 [6 H- z6 P* ~0 v% n: T
.Z* c- J, n, V5 M2 O
.tar.Z
8 M# y( i4 ?: m* e$ U.tgz
3 z2 m/ \; j$ y! V o9 ~2 S.tar.tgz9 \0 N: S6 P) Z0 e: l" e m& C
.7z8 m( x e- a4 a
.zip
1 v% U. t) D4 E' i$ T, N0 T.rar
; B( R7 j+ l) \.lha
. @9 k. F' r- p, T) D/ k U+ m. }" U
split : 憭扳脫撠瑼靘憒:
& V- N. ^! }- j' `: @ c* V銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞 - Z7 E: f- \- `8 N* ~
split -b 50m file.tar.gz (m 臭誑寞G(giga))' |2 f7 H1 [3 W% }) _! [ B
亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:
* w/ E1 W& ]9 T$ Vcat xaa xab xac xad xae xaf > file.tar.gz* i& p, b; N4 x5 O A
" R( I0 n2 c5 Y5 c- F( n( V1 X. m w/ X3 U
:
- J0 S5 ]' U- O- Jhttp://note.drx.tw/2008/04/command.html1 C9 v: Q+ V# u2 g5 Z8 P4 J+ r4 v
# d. Z% S$ G" w! K& v
|
|
|