Create zip file and ignore directory structure

后端 未结 7 1057
栀梦
栀梦 2020-12-07 10:38

I need to create a zip file using this command:

zip /dir/to/file/newZip /data/to/zip/data.txt

This works, but the created zip file creates

7条回答
  •  遥遥无期
    2020-12-07 11:19

    Alternatively, you could create a temporary symbolic link to your file:

    ln -s /data/to/zip/data.txt data.txt
    zip /dir/to/file/newZip !$
    rm !$
    

    This works also for a directory.

提交回复
热议问题