Zip Command Not Working

How to add man and zip to git bash installation on Windows

2016: The zip command can be installed from GoW (Gnu On Windows). man is not provided (too big).

It is to note, however, that if you only want to add the zip command from GoW, still the whole GoW system has to be downloaded and installed. Then you can delete the other commands from the bin directory, however make sure to keep the needed dlls in the directory.

Update 2021: tar/zip are by default installed on Windows 10.

7-zip based solutions are available below.

GitLab Pipelines: zip: command not found after installing zip on docker image?

Correct script below:

build:
stage: build
script:
- apt-get install zip unzip
- yarn install
- ./node_modules/@angular/cli/bin/ng build --prod
- cd dist/AngularTemplate; zip -r ../../dist.zip *; cd ..; cd..
artifacts:
paths:
- dist.zip

Was installing the wrong Zip package and then puttin my archive in the wrong folder.

zip command not zipping files in shell script

zip expects file args, and the file type can be a directory.
The example zip command did what it was told: archive 1 directory, not the contents of that dir.
Try -r or --recurse-paths, eg:

zip -r $NUMBER.NEW.$NAME.zip test

How to zip a file using cmd line?

If you are using Ubuntu Linux:

  1. Install zip

    sudo apt-get install zip
  2. Zip your folder:

    zip -r {filename.zip} {foldername}

If you are using Microsoft Windows:

Windows does not come with a command-line zip program, despite Windows Explorer natively supporting Zip files since the Plus! pack for Windows 98.

I recommend the open-source 7-Zip utility which includes a command-line executable and supports many different archive file types, especially its own *.7z format which offers superior compression ratios to traditional (PKZIP) *.zip files:

  1. Download 7-Zip from the 7-Zip home page

  2. Add the path to 7z.exe to your PATH environment variable. See this QA:
    How to set the path and environment variables in Windows

  3. Open a new command-prompt window and use this command to create a PKZIP *.zip file:

    7z a -tzip {yourfile.zip} {yourfolder}

Cross-platform Java:

If you have the Java JDK installed then you can use the jar utility to create Zip files, as *.jar files are essentially just renamed *.zip (PKZIP) files:

jar -cfM {yourfile.zip} {yourfolder}

Explanation:
* -c compress
* -f specify filename
* -M do not include a MANIFEST file

how can I run zip through cmd, where it's not found?

You need to install the aplication. Later, add the folder where is located to your system PATH environment variable.

Issue when creating zip file from directory

From the zip help:

zip(zipfile, files, flags = "-r9X", extras = "",
zip = Sys.getenv("R_ZIPCMD", "zip"))

zip A character string specifying the external command to be used.

As you can see, the zip function has an argument zip to specify the external command to be used. On my machine it is:

λ where zip
C:\Oracle\Ora11\BIN\zip.exe
C:\Program Files\Rtools\bin\zip.exe

The zip program is available in Rtools, but it is also available on any (Windows?) machine, usually.

To check whether zip is found by R, type:

> Sys.which("zip")
zip
"C:\\Oracle\\Ora11\\bin\\zip.exe"

If you get "", that means zip is not in the path, and if it is neither in the environment variable R_ZIPCMD, you have to specify its path in the zip argument.



Related Topics



Leave a reply



Submit