Skip to content

Commit

Permalink
fix: fix the typo and add some examples (#439)
Browse files Browse the repository at this point in the history
* docs: update tar.md

* docs: update tar.md
  • Loading branch information
Makonike authored Oct 28, 2022
1 parent dc05a4e commit ce53d4a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion command/tar.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,17 @@ tar -jcvf log.tar.bz2 log2012.log 打包后,以 bzip2 压缩

**解压目录**

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

```shell
tar -xvf portal-web-v2.0.0.tar --strip-components 1 -C 指定目录

示例
tar -xvf xxx.tar.gz -C /usr/src/a
/usr/src/a/xxxxx/src/opp/b.txt

tar -xvf xxx.tar.gz -strip-components=1 -C /usr/src/a
/usr/src/a/src/opp/b.txt
```

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

0 comments on commit ce53d4a

Please sign in to comment.