当前位置:网站首页>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))
边栏推荐
猜你喜欢
阿里三面:MQ 消息丢失、重复、积压问题,该如何解决?
"By sharing" northwestern university life service | | bytes a second interview on three sides by HR
特殊的日子,值得纪念
crypto-js uses
NIO编程
MATLAB程序设计与应用 2.5 MATLAB运算
Self-made a remote control software - VeryControl
零代码网站开发利器:WordPress
I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
【HDLBits 刷题】Circuits(1)Combinational Logic
随机推荐
gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
搜索框字符自动补全
22牛客多校1 I. Chiitoitsu (概率dp)
Golang:go静态文件处理
问下 mysql向pg同步多个表的话 有什么好的方案吗?
Golang:go开启web服务
POJ2031空间站题解
Dbeaver connect the MySQL database and error Connection refusedconnect processing
centos 安装php7.4,搭建hyperf,转发RDS
Electromagnetic compatibility introductory tutorial (6) test project
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
The use of Golang: go template engine
基于百度OCR的网站验证码在线识别
爆肝3万字,最硬核丨Mysql 知识体系、命令全集 【建议收藏 】
JVM: Runtime Data Area - PC Register (Program Counter)
datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法
Golang: go static file processing
app 自动化 通过工具查看app 元素 (三)
C语言学习概览(二)
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外