【问题标题】:Argument list too long for textutil conversiontextutil 转换的参数列表太长
【发布时间】:2019-11-10 00:26:35
【问题描述】:

我正在尝试将文件夹中的所有.docx 文件转换为.txt 文件。

我使用 textutil。

textutil -convert txt filepath/*.docx

我尝试了这个并且得到了一个“参数列表太长”的错误。

【问题讨论】:

    标签: command-line textutils


    【解决方案1】:

    您可以为此使用find -exec

    find filepath \
        -maxdepth 1 \
        -type f \
        -name '*.docx' \
        -exec textutil -convert txt {} +
    

    这会在给定目录中找到所有以*.docx 结尾的文件,并尽可能少地运行textutil 命令,而不会遇到“参数列表太长”的错误。

    【讨论】:

      猜你喜欢
      • 2019-06-03
      • 2017-11-30
      • 2020-05-09
      • 2014-05-21
      • 2015-04-04
      • 2021-10-26
      • 2014-04-18
      • 2021-10-28
      • 1970-01-01
      相关资源
      最近更新 更多