tldr/pages.zh/osx/textutil.md

25 lines
723 B
Markdown
Raw Normal View History

2019-03-18 04:17:10 +00:00
# textutil
> 用于操作各种格式的文本文件。
2022-01-14 12:59:47 +00:00
> 更多信息:<https://ss64.com/osx/textutil.html>.
2019-03-18 04:17:10 +00:00
- 显示有关 `foo.rtf` 的信息:
2019-03-18 04:17:10 +00:00
`textutil -info {{foo.rtf}}`
-`foo.rtf` 转换为 `foo.html`:
2019-03-18 04:17:10 +00:00
`textutil -convert {{html}} {{foo.rtf}}`
- 将带格式的 rtf 文本转换为普通 txt 文本:
2019-03-18 04:17:10 +00:00
`textutil {{foo.rtf}} -convert {{txt}}`
-`foo.txt` 转换为 `foo.rtf`, 字体使用 Times 字号 10:
2019-03-18 04:17:10 +00:00
`textutil -convert {{rtf}} -font {{Times}} -fontsize {{10}} {{foo.txt}}`
- 加载当前目录中的所有 RTF 文件,连接其内容,并将结果作为 `index.html` 写入HTML 标题设置为"多个文件":
2019-03-18 04:17:10 +00:00
`textutil -cat {{html}} -title "多个文件" -output {{index.html}} *.rtf`