Linux zip command
Linux zip command is used to compress files.
zip is a widely used compression program, compressed file after it would otherwise generate compressed files that have the ".zip" extension.
grammar
zip [-AcdDfFghjJKlLmoqrSTuvVwXyz$][-b <工作目录>][-ll][-n <字尾字符串>][-t <日期时间>][-<压缩效率>][压缩文件][文件...][-i <范本样式>][-x <范本样式>]
Parameters:
- -A Adjust automatically unzip the executable file.
- -b <working directory> Specifies the directory to store temporary files.
- -c for each compressed file annotation.
- -d Delete the specified file from within the compressed file.
- -D Compression does not create the directory name in the paper.
- -f effect of this parameter and specify "-u" similar parameters, but not update the existing file, if certain documents not originally exist in the archive, using this parameter and add a compressed file.
- -F Try to repair corrupted compressed files.
- -g appended to the existing compressed file, rather than separately to create a new compressed file after file compression.
- -h online help.
- -i <template style> Only qualified compressed files.
- -j saves only the file name and its content without any storage directory name.
- -J Deleting files in front of unnecessary data.
- -k format compatible with MS-DOS file name.
- When -l compressed files, the LF character is replaced with LF + CR character.
- When -ll compressed files, the LF + CR LF characters replaced with characters.
- -L Display copyright information.
- After -m to compress a file and add the compressed file, delete the original file, namely the file to the compressed file.
- -n <suffix string> does not compress files with a specific suffix string.
- -o compressed document with the latest changes to the file, whichever time, the compressed file and change the time set to the same file.
- -q does not display during the execution of instructions.
- -r recursive processing, all the files and subdirectories in the specified directory be dealt with.
- -S Contains the system and hidden files.
- -t <Date Time> set the date of the compressed file to the specified date.
- Each file within the backup file -T check whether correct.
- -u replace newer files to the compressed file.
- -v display during the execution of instructions or display version information.
- -V Save VMS operating system file attributes.
- -w If the version number, this argument is only valid in the VMS operating system file name inside.
- -x <style template> exclude qualified file compression.
- -X Do not save extra file attributes.
- -y saved directly symbolic link, rather than the connection points to the file, this parameter is valid only in UNIX-like systems.
- -z for compressed files with comments.
- - Save $ compressed volumes first name of the file where the disk.
- - <Compression efficiency> compression efficiency is a value between 1-9.
Examples
Compressed file
# zip -v cp.zip a.c b.c c.c e.c adding: a.c (in=0) (out=0) (stored 0%) adding: b.c (in=0) (out=0) (stored 0%) adding: c.c (in=0) (out=0) (stored 0%) adding: e.c (in=0) (out=0) (stored 0%) total bytes=0, compressed=0 -> 0% savings
Compressed file
# [root@ubuntu a]# zip -v cp2.zip * #
Compression directory
# zip -r cp3.zip /root/
Delete files from the archive
# zip -dv cp.zip a.c