Linux Tar Description&A Demo Task
来源:互联网 发布:阿里巴巴农村淘宝面试 编辑:程序博客网 时间:2024/06/11 18:02
Linux Tar Description
DESCRIPTION:
Tar stores and extracts files from a tape or disk archive.
How to use:
The first argument to tar should be a function (list the Most commonly used)
- -c create a new archive
- -x extract files from an archive
- -f use archive file or device ARCHIVE
- -v verbosely list files processed
- -z gzip
- -j bzip2
- -J xz
Examples:
- Create archive.tar from files foo and bar,the archive.tar is the same size of the files
tar -cf archive.tar foo bar
- Create archive.tar by using gzip from files foo and bar,z means zip,the sizes decreases
tar -czf archive.tar foo bar
- performs the function above but verbosely list files
tar -czvf archive.tar foo bar
- this is identical to above except that the files are extracted instead of archived
tar -zxvf archive.tar
My One Task:
Send the document in 2017 to another server and keep the dir structure fixed.Hovever,there are thousands of small files ,so I should archived all the files located in 2017 directories before transfering for the purpose to Maximum utilization ofnetwork throughput.
Directories:
FutureDB/
├── DCE
│ ├── Day
│ │ ├── 2017.01.29
│ │ ├── …
│ │ ├── 2016.01.29
│ │ ├── …
│ ├── DB
│ └── Night
│ ├── 2017.01.29
│ ├── …
│ ├── 2016.01.29
│ ├── …
├── SHFE
│ ├── Day
│ │ ├── 2017.01.29
│ │ ├── …
│ │ ├── 2016.01.29
│ ├── DB
│ └── Night
│ ├── 2017.01.29
│ ├── …
│ ├── 2016.01.29
└── ZCZE
├── Day
│ ├── 2017.01.29
│ ├── …
│ ├── 2016.01.29
├── DB
└── Night
├── 2017.01.29
├── …
It is very convenient by using this command to archive
tar czvf /mnt/FutureDBDay.tar $(find /mnt/FutureDB/ -maxdepth 3 -name '2017.*' ) &
How to extract more than one tars
ls *.tar.gz | xargs -n1 tar xzvf
阅读全文
1 0
- Linux Tar Description&A Demo Task
- [codility]Task description
- [codility]Task description
- [codility]Task description
- Spring Task Demo .
- linux下安装.tar的压缩文件时报错 tar: This does not look like a tar archive
- A brief description of C++
- A brief description of C++
- linux--tar
- Linux [tar]
- linux+tar
- linux tar
- linux tar
- Linux:Tar
- linux tar
- linux tar
- linux tar
- Linux tar
- shell学习整理笔记
- 关于Java初初学者的各种基本数据类型的定义。
- [OpenGL]纹理贴图实现 总结
- Java中列出目录的树状结构
- 实施微服务架构的关键技术
- Linux Tar Description&A Demo Task
- 蓝桥杯 ALGO-90 算法训练 出现次数最多的整数
- Android端实现深度学习
- iOS高德地图集成
- POI 使用word模板生成word文档
- java 网络编程 一对多服务器
- Android中注解(Support Annotations)的使用
- 杭电2021发工资
- 树型数据在关系数据库中的存储方式辨析