Forrest logo
back to the textutil tool

textutil:tldr:60623

textutil: 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
try on your machine

The command "textutil" is a command-line utility in macOS used to manipulate text files and documents. In this case, the command is being used to concatenate multiple files and generate an indexed HTML file.

Here's a breakdown of the command:

  • "textutil": The command itself, indicating that we want to use the textutil utility.
  • "-cat": Specifies the action to be performed, which is concatenating files.
  • "${html}": This is a placeholder for the name of the HTML file you want to include in the concatenation.
  • "-title": Specifies the title of the output HTML file.
  • "Several Files": The desired title for the output HTML file.
  • "-output": Specifies the output file name and its location.
  • "${path-to-index-html}": This is a placeholder for the directory path and name of the output HTML file. You should replace it with the actual path where you want the resulting file to be saved.
  • "*.rtf": This is a wildcard that represents all RTF files in the current directory. These are the files that will be concatenated together.

To summarize, this command concatenates multiple RTF files (identified by the "*.rtf" wildcard) into a single HTML file, with the specified title "Several Files", and saves it at the specified location and file name indicated by the "${path-to-index-html}" placeholder. Make sure to replace the placeholders with the actual file and path names according to your situation.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the textutil tool