1. The function description compresses or decompresses the general file or directory. By default, the compressed package with the suffix "<;zip”" is generated. The zip command is similar to the winzip compression program in Windows
. The format is as follows: zip [options] compressed file name list of documents to be compressed unzip [options] The options for the compressed file name zip command and their descriptions are shown in Table 4.27. Table 4.27 Options and Descriptions of the zip Command
Option Meaning-r Recursive compression, all files and subdirectories under the specified directory are compressed -d Delete the specified file from the compressed file -i “ ” Only compress the files in the file list -x “file list” Exclude the file specified in the file list when compressing -u Update the file to the compressed file -m Add the file to the compressed file and compress it, delete the original file, ie Files are moved to a compressed file -F Try to repair corrupted compressed files -T Check that each file in the compressed file is correct - Compression level compression level is a 1 to 9 numeric unzip command option and its description is shown in Table 4.28 Show. Table 4.28 Options and Descriptions of the unzip Command
Option Meaning -x "File List" Unzip the file, but do not include the file specified in the file list -t Test the compressed file for damage, no decompression - v View the details of the compressed file, including the file size, file name, and compression ratio contained in the compressed file. It does not decompress -n. It does not overwrite existing files when decompressing. -o Overwrite existing files when unpacking, and does not require The user confirms the -d directory name to extract the compressed file to the specified directory. Example (1) Compress all files and directories in the /etc directory, set the compression level to the highest, and save to the file /opt/etc.zip. [root@mylinux ~]# zip -9r /opt/etc.zip /etc(2) Compress all files and subdirectories in the /var directory, save the compressed files to /opt except for the files of “*.log” Under contents. [root@mylinux ~]#zip –r /opt/var.zip /var –x “*.log”(3) Remove the etc/passwd file from /opt/etc.zip above from the archive . [root@mylinux ~]#zip /opt/etc.zip –d etc/passwddeleting: etc/passwd(4) Modified the /etc/inittab file and hope to update the changes to the /opt/etc.zip package. [root@mylinux ~]#zip –u /opt/etc.zip /etc/inittab If many files in the /etc directory have been modified or a lot of files have been added, you need to update all the information in the /etc directory to /Opt/etc.zip file. You can use the following command: [root@mylinux ~]#zip –u /opt/etc.zip /etc/* or use [root@mylinux ~]# zip –ru /opt/etc.zip /etc to see the point Is it mysterious? In the above example, in fact, "/etc/*” represents all the files and subdirectories in the /etc directory, and this is exactly the function of the zip command "-r". (5) Decompress the /opt/etc.zip compressed file to the /etc directory, except for the etc/inittab file, and if the same file appears during the decompression process, it will be overwritten without requiring the user to confirm. You can use the following command: [root@mylinux ~]#unzip –o /opt/etc.zip –x etc/inittab –d /etc
In the existing embedded LINUX system development process, all engineers are tired
1. Introduction to LVS1. Provide high availability and load balancing capabilities for application s
Redis is an open source, log-based, Key-Value database that is written in ANSI C, supports networki
Requirement scenario Using the proxy server HAProxy to load balance Mysql is a common solution. To
VMware View4.5 Virtual Desktop Solution FAQ
Scp copying between Linux hosts without entering a password
Linux system security optimization in several directions
How to use the SOFTETHER server under the Linux operating system
Kdump and crash configuration methods and failure analysis methods
Linux sar command using basic tutorial
Enhanced Security Devil Linux 1.6.1 Release
Compression and decompression methods for common compression formats under Linux
Shell monitoring linux system file changes
Yum installation error: Error: database disk image is malformed Solution
Microsoft Summary: What are the new features of Win8.1 Update
How can the service security of vista system improve
How to hide the most recently used files and common folders in win10
Win XP SP4 received Microsoft indirect confirmation
Using DNS Server to Realize Load Balancing
Life calendar in the second month of February, why do you want to cut your hair?
Win8 backup version information method
How to reduce the volume of other sounds in Win8 system