![]() ![]() git directory: unzip filename.zip -x "*.git/*" Overwrite Existing Files # In the following example we are extracting all files and directories from the ZIP archive except the. To exclude specific files or directories from being extracted, use the -x option followed by space-separated list of archive files you want to exclude from extracting: unzip filename.zip -x file1-to-exclude file2-to-exclude Exclude Files when Unzipping a ZIP File # Unzip will use the same password for all encripted files as long as it is correct. If the ZIP file is encrypted, unzip will prompt you to enter the password: unzip filename.zip archive: filename.zip A more secure option is to extract the file normally without providing the password. Typing a password on the command line is insecure and should be avoided. ![]() To unzip a file that is password-protected, invoke the unzip command with the -P option followed by the password: unzip -P PasswOrd filename.zip To unzip a ZIP file to a different directory than the current one, use the -d switch: unzip filename.zip -d /path/to/directoryįor example, to unzip the WordPress archive latest.zip to the /var/www/ directory, you’d use the following command: sudo unzip latest.zip -d /var/wwwīecause usually the user we are logged in as doesn’t have write permissions to the /var/Unzip a Password Protected ZIP file # unzip -q filename.zip Unzip a ZIP File to a Different Directory # Use the -q switch to suppress the printing of these messages. ![]() Suppress the Output of the unzip Command #īy default, unzip prints the names of all the files it’s extracting and a summary when the extraction is completed. ![]() You must have write permissions on the directory where you are extracting the ZIP archive. The extracted files are owned by the user ZIP files do not support Linux-style ownership information. To unzip this file to the current directory, you’d simply run the following command: unzip latest.zip In it’s simplest form, when used without any option, the unzip command extracts all files from the specified ZIP archive to the current directory.Īs an example, let’s say you downloaded the Wordpress installation ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |