How can I create a archive/zip of a whole directory via terminal?

Create Zip file using Ubuntu command
Create Zip file using Ubuntu command

For creating the zip you have installed zip. For installing zip execute the below command to terminal

 sudo apt-get install zip  

After the install the zip executes the below command into the terminal for creating zip files

 zip -r myfiles  

-r (recursive) –r  option is zip whole directories and files trees at once

 myfiles is the directory path which needs  to convert into a zip file.

produced zip name of the zip which have the directory structure as well as the files .

You can also tell where the zip file will. Here is the example /home/ubuntu/, will store at home /home/ubuntu/ path.

 The zip command comes with documentation telling you about all of its (many) options; type
 man zip  
to see that documentation.

No comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + ''; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();