how can i search for files and zip them in one zip file

前端 未结 3 622
走了就别回头了
走了就别回头了 2021-01-31 15:12

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

3条回答
  •  不思量自难忘°
    2021-01-31 16:00

    Your response is close, but this might work better:

    find -regex 'regex' -exec zip filname.zip {} +
    

    That will put all the matching files in one zip file called filename.zip. You don't have to worry about special characters in the filename (like a line break), which you would if you piped the results.

提交回复
热议问题