![如何找到 LaTeX 產生的 PDF 檔案?](https://rvso.com/image/88777/%E5%A6%82%E4%BD%95%E6%89%BE%E5%88%B0%20LaTeX%20%E7%94%A2%E7%94%9F%E7%9A%84%20PDF%20%E6%AA%94%E6%A1%88%EF%BC%9F.png)
我需要找到 LaTeX 產生的 PDF 文件,因為我想找到我製作的那些文件。我想find
可能會在這裡工作。
OS X El-Capitan
我執行了烏爾里希的提案find BitTorrentSync/ -exec pdfinfo {} + |grep pdftex
,但我得到了
find: pdfinfo: No such file or directory
find: pdfinfo: No such file or directory
...
問題是我的系統中還沒有pdfinfo
。
L.Levrel 的提議。我在使用 GNU 產品的地方運行gfind -name '*.pdf' | gxargs ggrep -al '^/Producer (pdfTeX'
,但進入 OS X El-Capitan
gxargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
ggrep: cademic: invalid context length argument
烏班圖16.04
由於錯誤,我無法運行 Ulrich 的提案這裡。 L.Levrel 的第一個提案不起作用,但它適用於xargs -0
find -name '*.pdf' | xargs -0 grep -al '^/Producer (pdfTeX'
LaTeX如何find
產生 PDF 文件?
答案1
您可以查看“/Producer”行:
find -name '*.pdf' | xargs grep -al '^/Producer (pdfTeX'
或用雙引號
find -name '*.pdf' | xargs grep -al "^/Producer (pdfTeX"
或使用以 null 分隔的檔案列表
find -name '*.pdf' -print0 | xargs -0 grep -al '^/Producer (pdfTeX'
答案2
基於 L.Levrel 回應,使用 OS X 中提供的工具(這也應該適用於 Ubuntu)。
find . -type f -name '*.pdf' -exec grep -alE '/Producer \(pdfTeX|/Producer\(pdfTeX' {} +