[英]Run a terminal command recursively for all files in a folder
I am working on a problem that requires me to extract text from a pdf. 我正在解决一个需要从pdf提取文本的问题。 I am using pdfbox in order to do so.
我正在使用pdfbox来这样做。 So, I run this command in the terminal (linux ubuntu):
因此,我在终端(linux ubuntu)中运行以下命令:
java -jar pdfbox-app-1.8.7.jar ExtractText [path leading to file here]
and everything works. 一切正常。 However, I want to do this recursively for thousands of files in a particular directory, so I don't have to manually plug in the pdf path every time.
但是,我想对特定目录中的数千个文件进行递归操作,因此不必每次都手动插入pdf路径。 I would appreciate any solution that's either from the terminal or a script.
我会很感激任何来自终端或脚本的解决方案。
使用find
命令:
find /path/to/directory -type f -exec java -jar pdfbox-app-1.8.7.jar ExtractText {} \;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.