当前位置:网站首页>zip package all files in the directory (including hidden files/folders)
zip package all files in the directory (including hidden files/folders)
2022-08-01 07:27:00 【fish_】
The most common compressed files in linux are .tar.gz, .zip, .gz. In linux, you have to get used to the days without .rar.
The following is a detailed explanation of the tar,zip command
tar -zcvf /home/files.tar.gz /files
tar -zcvf The full path of the generated file name after packaging the directory to be packaged
Example: putAfter the /files folder is packaged, a /home/files.tar.gz file is generated.
zip compression method:
Compress the current folder zip -r ./files.zip ./* -r means recursive
zip [parameters] [packaged file name] [packaged directory path]
Unzip unzip files.zip does not explain
The basic usage of the linux zip command is:
linux zip command parameter list:
-a convert file to ASCII mode
-F try to repair damaged archive
-h display help interface
-m delete source file after zipping file
-n specific strings do not compress files with specific suffix strings
-o set the latest change time of all files in the compressed file to the time of compression
-q quiet mode, when compressedWhen the command execution process is not displayed
-r Process all subdirectories and files in the specified directory together
-S Include system files and hidden files (S is uppercase)
-t Date putThe last modified date of the compressed file is set to the specified date, the date format is mmddyyyy
Example:
Package all files and folders in the /home/wwwroot/files/ directory into files.zip in the current directory
zip –q –r files.zip /home/wwwroot/files
The above command operation is to compress the files and folders of the absolute address. The following gives the compressed relative path directory
For example, in the current directory of Bliux, the following operations can achieve the same effect as above.
zip –q –r files.zip files
For example, in my files directory, the zip compression command I operate is
zip –q –r files.zip *
The above is done in silent mode and includes system files and hidden files
//
unzip syntax:
unzip [-cflptuvz][-agCjLMnoqsVX][-P
Additional note: unzip is a decompression program for .zip compressed files.
unzip parameter:
-c Display the result of decompression on the screen, and do the appropriate conversion to the characters.
-f Update existing files.
-l Display the files contained in the compressed file.
-p Similar to the -c parameter, it will display the decompressed result to the screen, but will not perform any conversion.
-t Check if the compressed file is correct.
-u is similar to the -f parameter, but in addition to updating existing files, also extracts other files in the compressed file into a directory.
-v Displays detailed information when executing yes.
-z Display only the comment text of the compressed file.
-a Perform necessary character conversions on text files.
-b Do not perform character conversion on text files.
-C File names in compressed files are case sensitive.
-j Do not process existing directory paths in compressed files.
-L Change all filenames in the archive to lowercase.
-M Send the output to the more program for processing.
-n Do not overwrite existing files when decompressing.
-o No need to ask the user first, the original file will be overwritten after unzip is executed.
-P
-q Executes without displaying any information.
-s Convert whitespace characters in filenames to underscore characters.
-V Keep VMS file version information.
-X When decompressing, save the original UID/GID of the file at the same time.
[.zip file] Specify a .zip compressed file.
[files] Specifies which files in the .zip archive are to be processed.
-d
-x
-Z unzip -Z is equivalent to executing the zipinfo command
Example:
Unzip /home/wwwroot/files.zip to the current directory
unzip files.zip
If this prompt appears:
-bash: zip: command not found ZIP compression cannot be performed because ZIP is not installed,
Run this installation command yum install zip
zip -r landui_com.zip *.[^.]*
Description:
-r recurse subdirectories
- All non-hidden files/folders
.[^.]* (all hidden files/folders, but exclude... (upper directory))
边栏推荐
- C语言学习概览(三)
- flink sql-client,怎么处理源端与目标增加端,sql-client包括映射表与JOB如
- LabVIEW RT中的用户界面更新速度
- pytest接口自动化测试框架 | parametrize叠加使用
- pytest接口自动化测试框架 | 跳过测试类
- Information system project managers must recite the work of the core test site (56) Configuration Control Board (CCB)
- Srping bean in the life cycle
- The use of Golang: go template engine
- 小程序全面屏手势配置案例
- sum of special numbers
猜你喜欢
MATLAB程序设计与应用 2.5 MATLAB运算
VSCode插件推荐(Rust环境)
LabVIEW中局部变量和全局变量的分配
VoLTE基础学习系列 | 企业语音网简述
dbeaver连接MySQL数据库及错误Connection refusedconnect处理
Vim三种模式
特别数的和
How to use Photoshop to composite star trail photos, post-processing method of night sky star trail photos
我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的
Information system project managers must recite the work of the core test site (56) Configuration Control Board (CCB)
随机推荐
Golang:go开启web服务
Delphi MDI appliction 文档最大化显示、去掉最大化最小化等按钮
VoLTE基础学习系列 | 企业语音网简述
pytest接口自动化测试框架 | 跳过测试类
Shell执行SQL发邮件
支付宝如何生成及配置公钥证书
Offer brush questions - 1
centos 安装php7.4,搭建hyperf,转发RDS
The log causes these pits in the thread block, you have to prevent
上课作业(7)——#598. 取余运算(mod)
mysql查看cpu使用情况
Detailed explanation of the crawler framework Scrapy
问下 mysql向pg同步多个表的话 有什么好的方案吗?
Dart exception details
Srping bean in the life cycle
信息系统项目管理师必背核心考点(五十六)配置控制委员会(CCB)的工作
special day to remember
仿牛客网项目总结
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
dbeaver连接MySQL数据库及错误Connection refusedconnect处理