标签:ima dog linux rar bzip lin 包管理 linux基础 源文件
压缩包管理
1. gzip .gz格式压缩包
分别进行压缩,不保留源文件,不进行打包操作
sailfish@sailfish-PC:~/test$ ls animal cat.txt dog.txt fish.txt sailfish@sailfish-PC:~/test$ gzip cat.txt dog.txt fish.txt sailfish@sailfish-PC:~/test$ ls animal cat.txt.gz dog.txt.gz fish.txt.gz
恢复
sailfish@sailfish-PC:~/test$ ls animal cat.txt.gz dog.txt.gz fish.txt.gz sailfish@sailfish-PC:~/test$ gunzip *.txt.gz sailfish@sailfish-PC:~/test$ ls animal cat.txt dog.txt fish.txt
无法压缩目录
2. bzip2 .bz2格式压缩包
压缩
//不保留源文件
sailfish@sailfish-PC:~/test$ bzip2 *.txt sailfish@sailfish-PC:~/test$ ls animal cat.txt.bz2 dog.txt.bz2 fish.txt.bz2
//保留源文件
sailfish@sailfish-PC:~/test$ bzip2 -k *.txt
sailfish@sailfish-PC:~/test$ ls
animal cat.txt cat.txt.bz2 dog.txt dog.txt.bz2 fish.txt fish.txt.bz
解压缩
sailfish@sailfish-PC:~/test$ bunzip2 *.txt.bz2 sailfish@sailfish-PC:~/test$ ls animal cat.txt dog.txt fish.txt
无法压缩目录
3. tar .tar
4. rar .rar
5. zip .zip
标签:ima dog linux rar bzip lin 包管理 linux基础 源文件
原文地址:https://www.cnblogs.com/sailifsh-lyh/p/10807009.html