我如何搜索文件并将其压缩为一个zip文件 [英] how can i search for files and zip them in one zip file

查看:96
本文介绍了我如何搜索文件并将其压缩为一个zip文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用以下命令搜索文件并将其压缩

I tried to search files and zip them with the following commmand

find . regexpression -exec zip {} \;

但是它不起作用.我该怎么办?

however it is not working. How can i do this?

推荐答案

您使用的命令将分别在每个文件上运行zip,请尝试以下操作:

The command you use will run zip on each file separately, try this:

find . -name <name> -print | zip newZipFile.zip -@

-@告诉zip从输入中读取文件.来自man zip(1)

The -@ tells zip to read files from the input. From man zip(1),

-@文件列表..如果将文件列表指定为-@ [不在MacOS上,则zip从标准输入而不是从命令行获取输入文件的列表. /p>

-@ file lists. If a file list is specified as -@ [Not on MacOS], zip takes the list of input files from standard input instead of from the command line.

这篇关于我如何搜索文件并将其压缩为一个zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆