|
嚜
Linux 蝔桀蝮株閫憯蝮格隞:
3 s7 [) v! w/ M4 N4 a1 @& I.tar4 d) A. t. O5 d; R5 o+ V
.gz
, S$ H! ]9 h- I* E" w5 U9 p# g.tar.gz * | g' }, s8 r" Y( \) I
湔配ar.gz憯蝮格扳銝瑼獢桅批嗾瑼獢: 靘憒4 C. o" h0 ^+ A7 ~
: https://askubuntu.com/questions/ ... pdate-a-tar-gz-file, W& y3 O9 l/ d+ g# |
1.)撠.tar.gz閫憯.tar4 \7 u% \3 L+ w
gunzip filename.tar.gz
% q! q+ M6 C" F- k7 S% ^9 X8 X0 \ 2.)湔.tar
m5 |5 y/ C. {* k5 w2 z tar -uvf filename.tar new_file 6 X b$ v* s6 W; Q2 @
tar -uvf filename.tar subdir/*
) y# W$ }7 G! Y& H4 W' u 3.)憯蝮桀歇湔唳.tar
$ |% H+ y( i4 v) y3 {- W" K/ i gzip filename.tar P4 `/ u0 `4 w
1 q( D! Y( p& x1 U2 v$ c5 w \
支喳蝮桃桅瑼獢: 靘憒
/ j" r" ^" B( B' c9 Z2 d4 h! K- _ 閬隞賜桅 aaa
5 ?& B9 u# t/ A. o9 r$ O5 i" w; w& e 銝唾隞賜 aaa 鋆⊿Y bbb 摮桅
+ E' D' s3 f7 Y) m/ }8 c" O, `) b tar zpcvf aaa_backup.tar.gz --exclude=./aaa/bbb ./aaa1 f9 [* k3 O3 o. g
2 c% j: j4 w$ q+ Z& e憯蝮桐怨楝敺鞈閮(蝯撠頝臬): 靘憒
) [% ^ s. z9 j9 T, E' u 閬憯蝮 /home/user1/tmp/* ,( a.txt ,b.txt)銝蝞∠桀撌乩桅典,賢臭誑餅桅鞈閮,靘憒 桀撌乩桅 /
+ @% N1 v8 @$ N# D # tar -zcvf tmp.tar.gz -C /home/user1 tmp (tmp銝蝛箸)銝靽" /home/user1"頝臬6 h( r: q8 U$ X J0 D6 K1 a
# tar -ztvf tmp.tar.gz 9 x k8 l$ l( B8 Q; E, b
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/1 I2 C& ` _% k1 r
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt$ N9 E7 @+ l! M9 V+ o
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt
; y: y* u& e/ Q$ n+ [6 B) M/ S # tar -zcvf tmp.tar.gz -C /home/user1/tmp . (tmp敺銝蝛箸澆銝暺)銝靽" /home/user1/tmp"頝臬
% v- ? |0 w s" z! T! H+ @ # tar -ztvf tmp.tar.gz
4 K- ~9 w3 Y" ?+ a' O) W0 b% l drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./: a: \# v# u' G2 ~) @
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt$ W; k8 Y+ \% s3 X0 R; G
-rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt
- c4 f" ~* O/ x2 I! O! X 桀撌乩桅 /home/user1' f6 S1 f, E( b- k6 \$ h: V
# tar -zcvf tmp.tar.gz tmp+ K2 ^; E9 |1 y
# tar -ztvf tmp.tar.gz# g9 p( x4 C$ b, A
drwxrwxr-x user1/user1 0 2018-04-07 12:10 tmp/
2 i+ y4 ~& q+ ]) C -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/a.txt
/ A4 z9 C, a2 `2 D9 Z" {9 x9 P -rw-rw-r-- user1/user1 13 2018-04-07 12:10 tmp/b.txt' P6 a: ^6 Q2 u0 B5 e
# tar -zcvf tmp.tar.gz -C tmp . (銝暺)銝靽" tmp"頝臬
8 T" P. r3 r9 a$ }1 ^ # tar -ztvf tmp.tar.gz
- k3 {1 e- x- T6 A- b drwxrwxr-x user1/user1 0 2018-04-07 12:10 ./
2 l$ h. H2 w, T% {) Q -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./a.txt
5 ?4 K* {. Z6 {% }$ n7 l' J% r8 l -rw-rw-r-- user1/user1 13 2018-04-07 12:10 ./b.txt$ P# x: m- v' x* _) N/ } A
2 ~6 V' G2 F% }$ Y5 L閫憯蝮桀唳摰桅 靘憒 閫憯/home/user1/tmp.tar.gz /home/user1/tmp 撌乩桅/home/user1
- L$ ^/ ?' Y8 H5 P" O # tar -C tmp -zxvf tmp.tar.gz 臭誑雿輻函詨頝臬, -C(憭批神)銝摰閬亙系ar敺,嗡雿蝵桅賭銵
0 F3 e1 @ z# ` E # tar -C /home/user1/tmp -zxvf tmp.tar.gz 臭誑雿輻函撠頝臬5 h. M6 @5 i; O+ B+ V9 B
憒撌乩桅/home 隞亙雿蝵桀停閬雿輻函撠頝臬' a9 v: m9 y" _8 s5 p( d6 M& ]; C( F
.bz
- A/ G' Q6 G! h. ~.tar.bz' F" t6 l) d* H+ W5 d5 s0 l% e' w
.bz2" _. g ?; a9 s; ~( |! _9 m
.tar.bz2* `% S) a0 E3 G$ H
.xz& {) Q4 A/ o2 f
.tar.xz
: c; i5 Z% t8 F. I$ ^- o: C.Z) S! @2 ^6 C2 o. L8 `
.tar.Z# [7 X- u+ ~; @( `
.tgz
. A' T8 u/ q! P' }, K* C9 G.tar.tgz3 T) _7 n; ]6 R& g' ]$ D
.7z
! j ^8 D4 F* [7 M$ G3 T.zip$ X: U- X p6 u e5 C# ]
.rar
. o) Y$ q% M4 I# {.lha
4 ~1 q; v U, [( U: A3 n
- q6 H4 f5 T: ?6 [split : 憭扳脫撠瑼靘憒:, _5 `) t+ L" m A+ S7 F; u7 e
銝500MB瑼獢(file.tar.gz),脫瘥瑼50M撠瑼獢臭誑其誑銝隞
Q5 V* l) @. y1 x$ I: S) G) X- Ssplit -b 50m file.tar.gz (m 臭誑寞G(giga))
9 v/ ?3 I# J# Z! u9 R亥雿 臭誑牢at 隞斗鈭撠瑼獢雿菜銝憭扳獢 靘憒:
: H8 K3 e% S/ D0 h$ f( Ocat xaa xab xac xad xae xaf > file.tar.gz
. o7 c L; }* c, i" F. J
7 Y. R N, ?# u, a4 k; S4 e
( C- @' Z) g; b3 Y : " k/ } y6 N8 i: e2 w5 c" M
http://note.drx.tw/2008/04/command.html
6 I8 ]* [, N4 W6 b, r! k6 J7 W$ g7 B q4 h' P n9 r1 Y
|
|
|