主角是 find ,不使用 xargs 時,搭配 -exec 指令:
find ~/.personal/tips \
    -type f \
    -iname "*.pdf" \
    -exec pdftotext '{}' - ';' \
  | grep hot使用 xargs 時,搭配 -print0 指令:
find ~/.personal/tips \
    -type f \
    -iname "*.pdf" \
    -print0 \
  | xargs -0 -J % -n 1 pdftotext % - \
  | grep hot看來前者是比較簡潔一點
 

沒有留言:
張貼留言