How to create a zip file without entire directory structure

前端 未结 4 453
孤街浪徒
孤街浪徒 2021-01-04 00:58

I am trying to create a zip file and want to preserve most of the directory structure, but not the rootdir as defined from the command line. The command I\'m using is:

4条回答
  •  忘掉有多难
    2021-01-04 01:54

    I don't believe zip has a way to exclude the top level directory. I think your best bet would be to do something like: pushd /foo; zip -r out.zip ./bar; popd;

    But this is exactly the sort of answer you said you didn't want.

提交回复
热议问题