2025-03-14 21:59:59 -06:00
# textutil
> Manipulate text files of various formats.
> More information: <https://keith.github.io/xcode-man-pages/textutil.1.html>.
2025-12-16 10:20:31 -07:00
- Display information about `file.rtf` :
2025-03-14 21:59:59 -06:00
2025-12-16 10:20:31 -07:00
`textutil -info {{path/to/file.rtf}}`
2025-03-14 21:59:59 -06:00
2025-12-16 10:20:31 -07:00
- Convert `file.rtf` into `file.html` :
2025-03-14 21:59:59 -06:00
2025-12-16 10:20:31 -07:00
`textutil -convert html {{path/to/file.rtf}}`
2025-03-14 21:59:59 -06:00
- Convert rich text to normal text:
2025-12-16 10:20:31 -07:00
`textutil {{path/to/file.rtf}} -convert txt`
2025-03-14 21:59:59 -06:00
2025-12-16 10:20:31 -07:00
- Convert `file.txt` into `file.rtf` , using Times 10 for the font:
2025-03-14 21:59:59 -06:00
2025-12-16 10:20:31 -07:00
`textutil -convert rtf -font Times -fontsize 10 {{path/to/file.txt}}`
2025-03-14 21:59:59 -06:00
- Load all RTF files in the current directory, concatenates their contents, and writes the result out as `index.html` with the HTML title set to "Several Files":
`textutil -cat {{html}} -title "Several Files" -output {{path/to/index.html}} *.rtf`