Fork me on GitHub

Ubuntu下zip压缩文件夹路径不匹配的问题

@z-Default-string:~/PycharmProjects$ zip -r Animal_Behaviour_0908_2.zip ~/PycharmProjects/Animal_Behaviour_0908_2
    zip warning: name not matched: /home/z/PycharmProjects/Animal_Behaviour_0908_2

zip error: Nothing to do! (try: zip -r Animal_Behaviour_0908_2.zip . -i /home/z/PycharmProjects/Animal_Behaviour_0908_2)

路径明明没问题,后面知道是得这样

zip -r Animal_Behaviour_0908_2.zip /home/z/PycharmProjects/Animal_Behaviour_0908\ _2

  

By adding a backslash (\) before the space, you tell the shell to treat the space as part of the directory name rather than an argument separator.
posted @ 2024-09-08 21:57  z_s_s  阅读(115)  评论(0)    收藏  举报