假设结构:
/foo/bar/
--file1
--file2
--file3
--folder1
--file4
--folder2
--file5
Run Code Online (Sandbox Code Playgroud)
我想运行unix zip实用程序,从bar文件夹压缩文件夹及其所有文件和子foo文件夹,但bar只使用命令行在zip中没有文件夹.
如果我尝试使用该-j参数,它不会根据需要在zip中创建bar文件夹,但不会创建folder1和folder2.做-rj不起作用.
(我知道我可以进入内部栏并且zip -r bar.zip .我想知道是否有可能完成$/foo/bar/zip -r bar.zip .但是从$/foo执行它).