LinuxCommandLibrary

print

Shell built-in text output command

TLDR

Print text (zsh/ksh)

$ print "Hello, World!"
copy
Print without newline
$ print -n "text"
copy
Print to file descriptor
$ print -u [2] "Error message"
copy
Print with escape sequences
$ print "Line1\nLine2"
copy

SYNOPSIS

print [options] [args]

DESCRIPTION

print is a shell built-in command available in ksh and zsh that outputs text to stdout. It provides more control than echo, supporting escape sequence processing, output to specific file descriptors, and suppression of the trailing newline.
The -u option directs output to a numbered file descriptor (useful for writing to stderr or other open descriptors), while -l prints each argument on a separate line. Unlike echo, print's behavior is consistent and not affected by argument values that look like options.

PARAMETERS

ARGS

Text to print.
-n
No trailing newline.
-r
Ignore escape sequences.
-u N
Print to file descriptor N.
-l
Print arguments on separate lines.

CAVEATS

Shell built-in. Not available in bash (use printf).

HISTORY

print is a ksh/zsh built-in for text output.

SEE ALSO

echo(1), printf(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community