8000 Update tar.md · unlinux/linux-command@fa0a1b2 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit fa0a1b2

Browse files
authored
Update tar.md
1 parent 4de13a7 commit fa0a1b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

command/tar.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ tar -jcvf log.tar.bz2 log2012.log 打包后,以 bzip2 压缩
182182

183183
在选项`f`之后的文件档名是自己取的,我们习惯上都用 .tar 来作为辨识。 如果加`z`选项,则以.tar.gz或.tgz来代表gzip压缩过的tar包;如果加`j`选项,则以.tar.bz2来作为tar包名。
184184

185+
186+
**解压目录**
187+
188+
去掉第一层目录结构,要出除第二层,--strip-components 2
189+
190+
```bash
191+
tar -xvf portal-web-v2.0.0.tar --strip-components 1 -C 指定目录
192+
```
193+
185194
**查阅上述tar包内有哪些文件**
186195

187196
```

0 commit comments

Comments
 (0)
0