UNIX – LINUX – Zip all files in directory

Trying to zip all files in directory:

  • The Command to zip all files in a Directory would :
bash code
zip -r <> <directory>


bash code
zip -r mydata


bash code
zip -r mydata/*
  • Where r is for zip the Directory Recursively.

zip each file into its own archive, so you did the following (in zsh):

javascript code
$ for file in *; do zip ${file%.*}.zip $file; done

zip all files in directory:

bash code
cd /path/to/your/folder/www
zip -r *


bash code
mv /some/other/path
READ  Difference between Linux and Unix

About the author

Wikitechy Editor

Wikitechy Editor

Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.