如何压缩 ZIP 中没有子目录的文件?

How to ZIP files without subdirectories inside the ZIP?

我里面有 CSV 文件 data/processed/:

data
  processed
     file1.CSV
     file2.CSV
     file3.CSV
     file4.CSV
     file5.CSV

我想创建一个包含所有这 5 个文件的存档:

data.ZIP
     file1.CSV
     file2.CSV
     file3.CSV
     file4.CSV
     file5.CSV

我试图执行这个命令:

!zip -r data.zip data/processed/

但是,ZIP 文件如下所示:

data.zip
    data
        processed
              file1.CSV
              file2.CSV
              file3.CSV
              file4.CSV
              file5.CSV

使用-j忽略所有路径信息。来自 man page:

   -j
   --junk-paths
          Store  just the name of a saved file (junk the path), and do not
          store directory names. By default, zip will store the full  path
          (relative to the current directory).