|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:
! k' {; `1 X3 z1 P2 {' z1 ].tar
3 X* |: a3 ~) U0 @3 B! B" `.gz
) u* L6 [# f& x j9 C# z.tar.gz
1 i( k8 G% @2 F6 p& I1 q7 ^湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒
" B, [0 G2 N5 ]1 Z3 X7 z% I9 w/ U: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file
$ \7 a' F6 Y4 B# f 1.)撠.tar.gz閫憯.tar
) ^, C" E3 j+ p# Q; K6 m( A, D" f gunzip filename.tar.gz
, z" I; l( c7 O& {, K4 I 2.)湔.tar
% a, B( E# z. T, x, D3 D& C tar -uvf filename.tar new_file : s& c& z; k: K8 c' r9 U
tar -uvf filename.tar subdir/*% ^! B3 W7 @3 @$ ?2 U
3.)憯蝮桀歇湔唳.tar$ k& e: k3 K% Y4 X
gzip filename.tar
7 ^) D3 Q. c0 H: t' i: p( A- H$ k- ~! }1 b/ _; S6 Y$ e
支喳蝮桃桅瑼獢: 靘憒
! H6 R5 u8 B$ W; F0 M; Q 閬隞賜桅 aaa
_/ m5 Q0 ?) N% [1 Q$ F 銝唾隞賜 aaa 鋆⊿Y bbb 摮桅 ) c- i$ w) |# g, h. u! ^
tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa4 u% y6 {2 [$ ~
! o0 e5 F- S6 E3 f1 ]憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
4 v; L% {1 m+ A# b% }) F$ x 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /8 ?% d0 z( _& I$ _
# tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬
! p% P4 P2 n4 H' B* D' |5 |' M6 } # tar -ztvf tmp.tar.gz
- O3 S9 r8 ?) D/ p: } drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/! x2 B1 k$ `' P- _1 ?8 q
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
) b# c! F( W9 ?5 K t4 v, ` -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
/ |0 i. Y$ O2 S: I3 S # tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬
' e/ {6 G4 z* \' B! b4 H' ` # tar -ztvf tmp.tar.gz
. h! E" C5 p j0 X, s( T drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
" ]$ H! m$ F+ Q K, n -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
' _4 d( r( _7 P" [" h -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt L5 n* X% z+ S3 y+ o2 Y" X# V
桀撌乩桅 /home/user11 d9 u4 S' y9 A# G( ?# {. b2 k
# tar -zcvf tmp.tar.gz tmp
/ b- H$ }% I# c8 C1 j1 p- i # tar -ztvf tmp.tar.gz& n1 b! z8 f1 P, @: U5 K
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/( e4 h1 g, ~, c V( L- ^
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
& i/ D2 ~3 c% D1 u- }" Z/ ` -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt" w& m8 s9 @* J! [6 O
# tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬
7 A4 ? r+ T, R" u # tar -ztvf tmp.tar.gz* P( ^3 H1 R- I- q. s% T
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
: N/ q2 r- @3 N0 e5 h( x -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
/ M4 w Y& s: T+ D -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt9 x; w8 A) k# H. |# g3 v, K
e9 D- L# B2 I8 b( ~閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user1
) b" {# C1 N( u% M$ ^( Z( M/ i # tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵
' o4 E3 t" f5 R# ?; G2 F) v5 G # tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
7 h4 a9 e1 {$ ?4 p 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬
- f: b* O! k( f) x m9 r: \.bz
' ]' P: B: Z$ A0 z* T) ^.tar.bz
2 h4 ]9 T3 z+ j.bz2
0 {" I* V# j1 V.tar.bz2
2 I# d k/ m5 v.xz
/ J* m' P+ t& ?.tar.xz
+ c6 b6 U# T% }! D.Z! K9 G, J# e7 I+ K. g# F3 k& q
.tar.Z
7 e; ^# C: f) E( S5 k8 w.tgz
4 [" K0 l m1 n5 h.tar.tgz0 k' O$ a5 O9 ?& d2 C5 l
.7z
2 d; v, x. l0 w* M/ |( b.zip- [0 m; K, v- z+ q0 a
.rar5 S2 S0 |. h# {3 p+ J( `
.lha
$ {& a9 q7 M- `" U2 \; ]4 p7 ~. E( { q, I$ D$ L# t
split : 憭扳脫撠瑼靘憒:# h+ C* p% Q% f
銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞
, L& y8 D& V& T& p4 D! Wsplit -b 50m file.tar.gz (m 臭誑寞G(giga))
3 W. Z, O& M8 ^亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:: Y0 S- p' K. n6 I
cat xaa xab xac xad xae xaf > file.tar.gz
5 v& e6 ?. n$ G4 Y9 D5 a
+ [* O d0 ]$ F8 f: y$ Y- e
$ A% f) z4 r: V9 D: E0 J! E1 i : 0 e9 ?- l1 {; d, G
http://note.drx.tw/2008/04/command.html1 y# w. G1 d: k, u
6 T! ~0 o- l( n$ Z* f
|
|
|