Linux常用命令集合(详细版)
1.为/etc目录依次创建gzip格式、bzip2格式和xz格式的压缩包文件
[root@localhost ~]#tar -czf etc.tar.gz /etc
//创建gzip格式
[root@localhost ~]#tar -cjf etc.tar.bz2 /etc
//bzip2格式
[root@localhost ~]#tar -cJf ect.tar.xz /etc
//xz格式
2.创建(非压缩的)包文件my_file.tar.
[root@localhost ~]#tar -cvf my_file.tar
3.查询my_file.tar中的文件目录列表
[root@localhost ~]#tar -tf my_file.tar