Bar*_*ney 4 linux command-line
我希望在当前目录下递归地压缩*.html文件.
我目前的命令是:
zip all-html-files.zip *.html
Run Code Online (Sandbox Code Playgroud)
但这不会递归地起作用.似乎也没有添加-r选项.有人可以提供建议吗?我想压缩当前目录下的所有html文件,包括子目录下的那些文件,但只压缩HTML文件,而不是压缩文件夹.
谢谢!
那这个呢?
find /your/path/ -type f -name "*.html" | xargs zip all_html_files.zip
Run Code Online (Sandbox Code Playgroud)
查找.html目录下的所有文件/your/path(为您更改).然后,将结果通过管道传输xargs,从而创建zip文件.
要破坏路径,请添加-j选项:
find /your/path/ -type f -name "*.html" | xargs zip -j all_html_files.zip
Run Code Online (Sandbox Code Playgroud)