linux 求解

find . -type f -name "*.jpg" -print | xargs tar -czvf images.tar.gz

请问这里的-print 是啥意思?为啥前面有一个"-"

阅读 1.3k
1 个回答

man里面写得很清楚了,请看文档

-print True; print the full file name on the standard output, followed by a newline. If you are piping the output of find into another program and there is the faintest possibility that the files which you are searching for might contain a newline, then you should seriously consider using the -print0 option instead of -print. See the UNUSUAL FILE‐AMES section for information about how unusual characters in filenames are handled.
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题