Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Archive Utility is a built-in tool on macOS that allows users to compress and decompress files and folders. This utility is essential for managing file sizes, organizing data, and sharing files efficiently. Unlike third-party applications, Archive Utility is seamlessly integrated into the macOS environment, making it a convenient option for users. This article will guide you through the process of using Archive Utility, including how to access it via the graphical user interface (GUI) and the command line.
Examples:
Compressing Files and Folders:
.zip
extension will appear in the same directory.Decompressing Files:
.zip
).While Archive Utility itself does not have a direct command-line interface, macOS provides the zip
and unzip
commands that offer similar functionality.
Compressing Files and Folders:
zip -r archive_name.zip /path/to/folder_or_file
-r
option is used to recursively compress directories.zip -r my_archive.zip /Users/username/Documents/my_folder
Decompressing Files:
unzip archive_name.zip -d /path/to/destination_folder
-d
option specifies the directory where the contents should be extracted.unzip my_archive.zip -d /Users/username/Documents/extracted_files
For users who prefer automation, AppleScript can be used to compress and decompress files.
Compressing Files:
set theFolder to choose folder
set theZipFile to (theFolder as text) & ".zip"
do shell script "zip -r " & quoted form of POSIX path of theZipFile & " " & quoted form of POSIX path of theFolder
Decompressing Files:
set theZipFile to choose file
set theDestination to choose folder
do shell script "unzip " & quoted form of POSIX path of theZipFile & " -d " & quoted form of POSIX path of theDestination