— macOS, Terminal, Bash, ZIP, File Management — 1 min read
If you're tired of using Finder to create ZIP files, the Terminal offers a faster and more flexible way to compress folders. Let's dive into the essential commands you'll actually use day-to-day.
Want to zip up a folder quickly? Here's your go-to command:
1zip -r archive.zip folder_name
The -r
flag tells zip to include everything in the folder, including all subfolders.
Here are some time-saving options I use regularly:
1zip -r -X archive.zip folder_name
1zip -r -v archive.zip folder_name
1zip -r -9 archive.zip folder_name # Maximum compression2zip -r -1 archive.zip folder_name # Fastest compression
Need to leave out certain files? This command is your friend:
1zip -r archive.zip folder_name -x "*.DS_Store" "*/\.*"
This keeps your archives clean by excluding .DS_Store files and other hidden junk.
Got new changes? Update your ZIP without recreating the whole thing:
1zip -ru archive.zip folder_name
The -u
flag is smart - it only updates files that have changed.
-r
for folders (you'll thank me later)-v
for big folders so you're not left wondering if it's working-X
to avoid macOS system file crudBefore sending that ZIP file off, double-check what's inside:
1unzip -l archive.zip
Keep these commands handy in your shell history - they'll save you countless clicks through Finder. And remember, while GUI tools are fine, mastering these Terminal commands gives you way more control over your archives.