zip error – Nothing to do

To create a zipfile:

  • From a list of files, zip alice.png bob.jpg carl.svg. You need to specify both

    • the zipfile (output), and
    • the files you will zip (input).
  • From a folder, zip -r images_folder

To make it clearer than Alex’s answer, to create a zip file, zip takes in a minimum of 2 arguments. How do I know, because when you use man zip, you get its man page, part of which is:

zip  [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [--longoption ...]  [-b path]
       [-n suffixes] [-t date] [-tt date] [zipfile [file ...]]  [-xi list]

and when you typed zip in the command line, you get:

zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]

In both cases, notice [zipfile list] or [zipfile [file ...]]. The square brackets indicate something being optional. If you’re not saving to a zipfile, then the list argument is not required.

If you want to save into a zipfile (choosing the [zipfile list] option, you need to also provide list, because it is within the square brackets. For this reason, I prefer the output of zip instead of man zip. (The man page might be confusing)

Leave a Comment