我正在尝试从终端命令压缩文件夹(如下所示)
zip myZip.zip path\ Of\ the\ Folder
上述命令提供以下结果
我的命令错了吗?请帮忙,我只能用终端命令来做。
编辑
我也尝试了这些命令,但都不起作用。(也给出了结果)
NO.1
n:~ myUser$ zip -r abc.zip /Users/myUser/Desktop/Assets/img\ for\ seg/
adding: Users/myUser/Desktop/Assets/img for seg/ (stored 0%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa copy 3.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa copy 6.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa copy 64.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa copy 7.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa copy.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa mo e.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa moved.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/aaaa.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/moved aaaa.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/Screen Shot 2015-12-11 at 1.jpg (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_03.png (deflated 19%)
adding: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_05.png (deflated 21%)
adding: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_10.png (deflated 26%)
n:~ myUser$
2号
n:~ myUser$ zip myZip.zip /Users/myUser/Desktop/Assets/img\ for\ seg
adding: Users/myUser/Desktop/Assets/img for seg/ (stored 0%)
n:~ myUser$
3. 大都会
n:~ myUser$ zip myZip.zip -r /Users/myUser/Desktop/Assets/img\ for\ seg
updating: Users/myUser/Desktop/Assets/img for seg/Screen Shot 2015-12-11 at 1.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_03.png (deflated 19%)
updating: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_05.png (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/Screen-Shot-2015-12-11-at-1.17.11-pm_10.png (deflated 26%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa copy 3.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa copy 6.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa copy 64.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa copy 7.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa copy.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa mo e.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa moved.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/aaaa.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/moved aaaa.jpg (deflated 21%)
updating: Users/myUser/Desktop/Assets/img for seg/ (stored 0%)
n:~ myUser$
答案1
尝试这个命令
pushd /Users/myUser/Desktop && zip -r ./temp.zip ./Assets && popd