当前位置:网站首页>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))
边栏推荐
猜你喜欢

Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download

Offer刷题——1

MATLAB程序设计与应用 2.5 MATLAB运算

数据机构----线性表之单向链表

安装SQL Server详细教程

sum of special numbers

牛客刷SQL---2

rhcsa 第四天

日志导致线程Block的这些坑,你不得不防

对于升级go1.18的goland问题
随机推荐
Golang:go获取url和表单属性值
22牛客多校1 C.Grab the Seat (几何 + 暴力)
图像基本操作的其他内容
pytest接口自动化测试框架 | parametrize中ids的用法
数据分析5
pytest接口自动化测试框架 | 跳过模块
C语言学习概览(二)
Golang:go连接和使用mysql
pytest接口自动化测试框架 | 单个/多个参数
POJ2031空间站题解
Classwork (7) - #598. remainder operation (mod)
NIO编程
我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的
Zero-code website development tool: WordPress
Golang: go get url and form attribute value
JVM: Runtime Data Area - PC Register (Program Counter)
Srping bean in the life cycle
表的创建、修改与删除
电磁兼容简明教程(6)测试项目
Golang: go static file processing