to text for formats
Convert data into plain text format.
Signature
> to text {flags}
Flags
-
--no-newline, -n: Do not append a newline to the end of the text. -
--serialize, -s: Serialize nushell types that cannot be deserialized.
Input/output types:
| input | output |
|---|---|
| any | string |
Examples
Outputs data as simple text with a trailing newline.
> [1] | to text 1
Outputs data as simple text without a trailing newline.
> [1] | to text --no-newline 1
Outputs external data as simple text.
> git help -a | lines | find -r '^ ' | to text
Outputs records as simple text.
> ls | to text
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/to_text.html