当前位置:网站首页>1312_适用7z命令进行压缩与解压
1312_适用7z命令进行压缩与解压
2022-07-26 12:45:00 【grey_csdn】
我常用的工具的使用小结全都放在了这里: GreyZhang/toolbox: 常用的工具使用查询,非教程,仅作为自我参考! (github.com)
也不知道从什么时候开始,我开始使用各种NAS或者类似树莓派这样的开发板搭建家用的server以及我个人的数据中心。有时候,切换硬盘的时候需要进行数据搬运,而搬运的时候少不了压缩解压的操作。如果是一个整卷的压缩或者解压,之前我用的最多的还是zip和unzip,掌握的细致的用法没有几条,但是几本是可以满足我自己的需要的。但是,在这两个命令中我始终没找到比较好的分卷压缩以及解压的好的方式。
在使用PC以及GUI的时候,我这几年用的最多的压缩工具其实是7z,它基本上是拥有了我需要的压缩以及解压的全部功能。类似这样的开源软件,通常在命令行的支持上是不错的。我于是尝试了这方面的探索,结果是令我满意的。
在此,总结一下这个工具使用的时候的一些小经验。
1. 安装
安装其实是很容易的,一条命令即可,需要注意在linux的环境下可能有不同的分发版本,尽量安装全功能版本的。
sudo apt-get install p7zip-full
2. 压缩指定的文件
2.1 7z a xxx.7z xxx

这是参数比较少的一种使用方式,默认的情况下其实就可以生成7z的格式。

这是通过GUI的软件来查看看到的效果。一是看得出来格式能够识别,另外是看得出来压缩的内容没问题。
2.2 解压缩

我创建新的目录,把压缩的压缩包转移到了这个目录。之后执行解压的效果如上。
2.3 压缩目录

这是很让人开心的操作特性,默认的输入下,压缩一个目录以及目录下的全部文件就跟直接压缩一个文件一样简单。
2.4 7za命令

这个命令其实是专门用于压缩的7z命令,而7z还可以用于解压缩。
2.5 分卷压缩
7z的分卷压缩也非常简单,就是普通的压缩增加一个参数而已。-vxxxb,其中xxx是数值,单位是字节。如果想用其他的单位,格式类似,k、m、g等可以用。但是需要注意,这里的参数都是小写的。

我从帮助信息中找到了相应的信息。接下来,尝试把上面的文件夹压缩成分卷500KB的分卷。

2.6 分卷的解压缩

又是一个很简单的操作,跟处理一个文件一样。这里只需要把第一个分卷的名称传递进来,其他的操作都是自动完成的,十分方便。
2.7 压缩成指定的格式,比如zip

没有什么特殊的,只需要增加一个参数的控制。上面,我实现了一个zip的分卷压缩。而解压缩也是跟前面分卷的解压完全一样的处理方式。

单卷压缩,其实是一个更简单的操作。
这样,7z工具的基本使用情况于我来说比较实用的部分就已经梳理完了。或许,从此以后我的server上的最常用压缩以及解压软件就是这个了。
边栏推荐
- Backtracking - 46. Full arrangement
- Food safety | is self-made food purchased online healthy food? Don't fall into these misunderstandings
- 酷早报:7月25日Web3加密行业新闻大汇总
- Notes....
- 【TypeScript】TypeScript常用类型(上篇)
- 【TypeScript】TypeScript常用类型(下篇)
- Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee
- Shell variables and references
- Detailed interpretation of hole convolution (input and output size analysis)
- Shell变量和引用
猜你喜欢

Various extensions of hcip-9.ospf

Panorama of volcanic engine cloud growth plan: 30 + plans come out together, and military development advantage areas

PXE原理与配置

回溯——46. 全排列

C#把Type当做泛型T,来作为方法的泛型进行使用

1-6月中国ADAS供应商占比9% 又一家零部件巨头全面布局智驾新赛道

Interview JD T5, was pressed on the ground friction, who knows what I experienced?

被罚“带薪休假”一个月后,谷歌解雇了“爱”上 AI 的他

Sword finger offer 24. reverse the linked list

LCD notes (4) analyze the LCD driver of the kernel
随机推荐
Redis realizes single sign on -- system framework construction (I)
Kubernetes----PV和PVC的生命周期简介
Use float to realize left, middle and right layout, and the middle content is adaptive
一款超好用的神器Apifox,甩 Swagger 几条街...(荣耀典藏版)
The database consists of stored procedures and functions
数据库组成视图
Guys, please ask me, I have configured CDC to connect to Oracle according to the document, and I always run error reports and can't find the class validstione
可移动表空间
数据库组成表
After being fined "paid leave" for one month, Google fired him who "loves" AI
Flutter prevents scientific counting and removes mantissa invalid 0
Food safety | these common foods are poisonous! Check your dining table quickly
Knowledge points of C language documents
If there is a declaration "int x=5, y=1;", Then the expression x < y? The result of x++: y++ is:
Kubernetes---- installing and deploying NFS servers
Huawei ultra fusion fusioncube solution notes
维度灾难 维数灾难 暂记
0基础编程资源大全(先收藏~慢慢看~)
Example of establishing socket communication with Siemens PLC based on C # open TCP communication
How to view encrypted information in text form