It is possible to zip a target folder with encryption by the terminal command

zip -er ~/Desktop/myzippedfolder.zip ~/Documents/myfolder/

However, the contents of myzippedfolder will be a folder called Users containing a folder called username containing a folder called Documents containing the folder myfolder and its contents.

Is it possible to zip the folder myfolder only such that when myzippedfolder is unzipped it contains only myfolder and its contents rather than the parent folders?


2 Answers 2



cd to the correct directory first. For Example:

cd ~/Desktop

or alternatively, type cd [space], then drag your folder to terminal to auto-fill the path

  • 1
    Ill have you your +10 bonus. Jun 1, 2015 at 7:53

zip ~/Desktop/myzippedfolder.zip --out ~/Desktop/myfolder/ -s 1m

There is for copying: fileIntoZIP.

  • Where is the encryption in this?
    – mmmmmm
    Jul 8, 2015 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .