

MAC Terminal creates a directory path in your compressed (zipped) fileįor the most inquisitive amongst you you’d have noticed Terminal creates the directory paths in your zipped (compressed) file. Voilà the file path appears with all spaces escaped. Type in your commands to create a zip stopping before you get to the target’s directory path then drag & drop the folder you want zipping into the Terminal window. Genius-iMac:~ macgenius $ zip -er ~/Desktop/TheNameYouWantForYourNewZip.zip ~/Documents/Example\ Directory/Folder\ with\ files So now our command to compress a WHOLE DIRECTORY OF FILES located within folders might look something like this… To negotiate this we can escape each unwanted space with a backslash \ . Unfortunately our directory path to folders and files may very likely contain spaces. Terminal recognises a space as the start of a new command. So far we’ve put the folders and files on the desktop to avoid any mispelling of long file paths (making our life a little easier whilst learning). er = encrypt recursively through a whole directory of filesĮXPERT LEVEL - Mac zip and password protect ~ = start from the current users home directory e = the command to encrypt (password protection)

So far… zip = the command to compress (zip) If the new command doesn’t see a directory of files it won’t work. Remembering to point the new command to an actual folder (directory) of files. Instead of typing the command “ zip -e” type “ zip -er” So you want to compress and password protect a whole FOLDER (directory) of files? The zip file "TheNameYouWantForYourNewZip.zip" was created on your desktop with the password protection you assigned to it. NOTE: TERMINAL DOES NOT DISPLAY THE TYPING OF PASSWORDSĪdding: Users/macgenius/Desktop/YourFile.txt (deflated 3%) Genius-iMac:~ macgenius $ zip -e ~/Desktop/TheNameYouWantForYourNewZip.zip ~/Desktop/YourFile.txt NOTE: THERE MUST BE A SPACE BETWEEN EACH NEW COMMAND AND THERE MUST BE NO SPACES IN YOUR FILE NAMES. TO COMPRESS & PASSWORD PROTECT ONE FILE ON YOUR DESKTOP… Later I’ll show you how to access you file/s without having to move them on to your desktop first. To avoid any mistyping issues I suggest that you move your file or folder of files you want compressed and password protected to your desktop. You need to decide if you are compressing a file or a folder of files? Last login: Sun Oct 07 21:39:26 on console When opened it should look something like this and it’s ready to accept your keyboard input You need to open your “ Terminal” application found in… We are creating a new compressed (zipped) file with password protection. Objective: We are not assigning password protection to an already compressed (zipped) file. I’m currently running macOS High Sierra Version 10.13.6 You can do it on your mac without need for 3rd party Apps or Software. Password protect a compressed (zipped) file on a Mac
