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

VoLTE基础学习系列 | 企业语音网简述

安装SQL Server详细教程

Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast

rhcsa 第四天

升级为重量级锁,锁重入会导致锁释放?

Dbeaver connect the MySQL database and error Connection refusedconnect processing

如何使用Photoshop合成星轨照片,夜空星轨照片后期处理方法

电磁兼容简明教程(6)测试项目

国内外最顶级的8大plm项目管理系统

Three aspects of Ali: How to solve the problem of MQ message loss, duplication and backlog?
随机推荐
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
聊一聊ICMP协议以及ping的过程
数据机构----线性表之单向链表
搜索框字符自动补全
mysql查看cpu使用情况
pytest接口自动化测试框架 | 执行失败跳转pdb
Datagrip error "The specified database userpassword combination is rejected..."Solutions
dbeaver连接MySQL数据库及错误Connection refusedconnect处理
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图可视化股票月收益率数据、使用百分比显示Y轴坐标数据、使用不同的色彩表征正负收益率
特殊的日子,值得纪念
力扣每日一题-第44天-290. 单词规律
JSON 与 JS 对象的区别
gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
LeetCode240+312+394
LabVIEW中局部变量和全局变量的分配
special day to remember
金山打字通 官网 下载
mysql中添加字段的相关问题
七夕来袭——属于程序员的浪漫
app 自动化 打开app (二)