tar -xzvf mysql-5.6.15.tar.gz -C ./mysql-5.6.15 --strip-components 1
实践:
man tar
tar --strip-components = NUMBER
...skipping...
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
tar -zxvf codes.doc.qr.cntv.net.tar.gz -C abc/. --strip-components 1
打包来自:codes.doc.qr.cntv.net codes.doc.qr.cntv.net.tar.gz
再看解压后的目录无codes.doc.qr.cntv.net外层目录了:
tree -L 1 abc/
abc/
├── Application
├── index.php
├── netchkrs
├── Public
├── showdoc.sql
├── test.php
├── Text
└── ThinkPHP
实践来自:http://www.cnblogs.com/zxiaozhou/p/6068867.html
实践:
man tar
tar --strip-components = NUMBER
...skipping...
--strip-components=NUMBER
strip NUMBER leading components from file names on extraction
tar -zxvf codes.doc.qr.cntv.net.tar.gz -C abc/. --strip-components 1
打包来自:codes.doc.qr.cntv.net codes.doc.qr.cntv.net.tar.gz
再看解压后的目录无codes.doc.qr.cntv.net外层目录了:
tree -L 1 abc/
abc/
├── Application
├── index.php
├── netchkrs
├── Public
├── showdoc.sql
├── test.php
├── Text
└── ThinkPHP
实践来自:http://www.cnblogs.com/zxiaozhou/p/6068867.html
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/9355/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2020-5-29 16:16
评论列表