Skip to content

Commit ce53d4a

Browse files
authored
fix: fix the typo and add some examples (#439)
* docs: update tar.md * docs: update tar.md
1 parent dc05a4e commit ce53d4a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

command/tar.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,17 @@ tar -jcvf log.tar.bz2 log2012.log 打包后,以 bzip2 压缩
469469

470470
**解压目录**
471471

472-
去掉第一层目录结构,要出除第二层,--strip-components 2
472+
参数--strip-components NUMBER,在提取时从文件名中删除NUMBER个前导组件,如要去除前二层,参数为--strip-components 2
473473

474474
```shell
475475
tar -xvf portal-web-v2.0.0.tar --strip-components 1 -C 指定目录
476+
477+
示例
478+
tar -xvf xxx.tar.gz -C /usr/src/a
479+
/usr/src/a/xxxxx/src/opp/b.txt
480+
481+
tar -xvf xxx.tar.gz -strip-components=1 -C /usr/src/a
482+
/usr/src/a/src/opp/b.txt
476483
```
477484

478485
**查阅上述tar包内有哪些文件**

0 commit comments

Comments
 (0)