HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

textutil — Manipulate text files of various formats. More information: <https://keith.github.io/xcode-man-pages

Submitted by: @import:tldr-pages··
0
Viewed 0 times
textutilcommandvariousformatsfilestextmanipulatecli
macos

Problem

How to use the textutil command: Manipulate text files of various formats. More information: <https://keith.github.io/xcode-man-pages/textutil.1.html>.

Solution

textutil — Manipulate text files of various formats. More information: <https://keith.github.io/xcode-man-pages/textutil.1.html>.

Display information about file.rtf:
textutil -info {{path/to/file.rtf}}


Convert file.rtf into file.html:
textutil -convert html {{path/to/file.rtf}}


Convert rich text to normal text:
textutil {{path/to/file.rtf}} -convert txt


Convert file.txt into file.rtf, using Times 10 for the font:
textutil -convert rtf -font Times -fontsize 10 {{path/to/file.txt}}


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

Code Snippets

Display information about `file.rtf`

textutil -info {{path/to/file.rtf}}

Convert `file.rtf` into `file.html`

textutil -convert html {{path/to/file.rtf}}

Convert rich text to normal text

textutil {{path/to/file.rtf}} -convert txt

Convert `file.txt` into `file.rtf`, using Times 10 for the font

textutil -convert rtf -font Times -fontsize 10 {{path/to/file.txt}}

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

Context

tldr-pages: osx/textutil

Revisions (0)

No revisions yet.