Screen Output

echo

Print simple text on standard output.

printf

Print formatted text on standard output.

pbcopy

Copy standard input to the clipboard.

pbpaste

Copy the clipboard to standard output.

yes

Print repeated text on standard output.

clear

Clear the screen or window.

Terminal provides several commands for printing messages on standard output, such as echo:

echo hello world
hello world

Each command has different strengths and intended purposes. These commands are invaluable for learning about the shell, debugging problems, writing shell scripts (see Programming with Shell Scripts), or just talking to yourself.

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.