|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:
5 ~+ m) K- h: B2 h.tar! y6 ^$ `/ L# }1 X: ^! ]
.gz5 @1 M" j1 Z. C! Y
.tar.gz
1 ~+ k% A3 ^+ F1 `# T3 h湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒4 ?8 J6 G, d% C$ w4 J
: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file
7 Z# p+ F8 ^% S 1.)撠.tar.gz閫憯.tar/ m$ F: H3 `! R* E# Z8 L
gunzip filename.tar.gz
$ y% L5 z* D- Y: z- U 2.)湔.tar
4 J% q$ ?! p6 Z5 c tar -uvf filename.tar new_file 4 b' I C' e9 a% b2 h
tar -uvf filename.tar subdir/*4 I# {- `5 \( ]+ r
3.)憯蝮桀歇湔唳.tar. Z4 [# v3 h, V4 n& Z' e% P# v! ^
gzip filename.tar
- f+ _6 Y) [" H w
O2 V% r7 V: o" B0 v! h' s3 \+ X/ g支喳蝮桃桅瑼獢: 靘憒
: X1 E: U: ` C 閬隞賜桅 aaa4 c; L, m9 O0 @, z( b+ M. t
銝唾隞賜 aaa 鋆⊿Y bbb 摮桅 o# u- L! }( V% j4 z
tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa4 \, H* x1 X! b7 \( @1 J8 G
/ N6 h7 W' X$ M6 _( D
憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
: L5 `$ \: w* B 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
# F+ ^' h" Z! f # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬
9 w+ o1 P2 \# g9 O2 D) I # tar -ztvf tmp.tar.gz 5 H5 W! u. |. ]
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
8 X+ }, U3 @: \6 A$ O3 } -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
- L# D4 R; Q' h! } u -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt3 T c+ _* a4 o& X% C
# tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬, i: I6 u4 t2 q# a
# tar -ztvf tmp.tar.gz 8 q8 Z- _- Q$ y% X; [; O
drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./1 X5 K' q/ a% r
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
6 T8 |/ w" h: n2 O: w -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
) \5 T) {. A) }4 f 桀撌乩桅 /home/user1
: ~, J4 M) t1 C+ x2 z # tar -zcvf tmp.tar.gz tmp
7 I5 I: s3 R: p/ o/ ^- X. S # tar -ztvf tmp.tar.gz
0 y% v6 S: E% a drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
- Y: j) r& }# c% v -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt4 l( `) {, g, ?8 l
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
& @0 l( n& h6 h$ A. t9 c # tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬2 p& _' ]/ _ m |' g3 Z
# tar -ztvf tmp.tar.gz5 X1 O0 G2 z7 L$ k7 m* l
drwxrwxr-x user1/user1 0 2018-04-07 12:10 .// G2 j, I; \, q, [3 v
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt0 L7 U M! |" |" p- N4 |, H6 _
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
4 y1 x( s3 f3 H5 Z W, p0 K: y) y% a1 a' b9 T
閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user1
% O$ H- ]0 e+ ~4 P2 ^ K # tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵6 k& K; r/ ?2 E, L' |& V
# tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬
0 d( Q! B2 K/ y" {5 r 憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬9 ?5 C i/ t/ U
.bz) A: s% a. w+ ~/ R3 a" J" |6 F* a Z
.tar.bz
+ o4 i/ N; B0 m! T* w( M" J.bz2' k5 T$ l1 w7 G: d* E: [
.tar.bz2
& {1 b) w1 M7 Y" K, U: g2 @, }/ N4 i.xz. C) S1 M% s2 _! b
.tar.xz5 t6 x, O; D* x" y3 M N
.Z5 L# X, R; c: Z: d0 b
.tar.Z
7 R F6 ]6 D" u; c( D8 e.tgz& ]; [) G' g6 g
.tar.tgz
5 i$ B+ p2 H5 m+ U1 _& Y.7z
/ J8 R1 w5 T$ F4 a8 v.zip9 c( s0 k6 R% D6 ~1 Y
.rar. f$ @+ e3 D; Z: H; B
.lha
1 n! V; g c4 W" x8 b. C& Q( ~+ t0 O
$ H: t3 l2 d/ b0 ^split : 憭扳脫撠瑼靘憒:
0 _3 c* c: q8 ~6 t9 d. ~. v銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞
. Z" P5 d& r' l, F3 gsplit -b 50m file.tar.gz (m 臭誑寞G(giga))
! k' U& a6 {, F& V9 x6 x' Y, p: L% L亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:
4 d9 s! q' Z! y7 y$ Xcat xaa xab xac xad xae xaf > file.tar.gz6 _: i2 S4 T5 L, Z7 z, o; ?
- X) V" P- J1 O
& y, D- v4 q: ~
: ; x0 Q4 u% O$ l- T7 |+ `+ [, v# t
http://note.drx.tw/2008/04/command.html/ X" I; w* X" H% }2 F
6 Q, S) P$ Z9 ?' s' f |
|
|