🧀 Learn Linux

Common · Let commands collaborate

printf: Output text according to format

Put in free practice

Syntax

printf format [value…]

Options

%s
string
%d
number
%%
percent sign
\n
newline

Examples

printf "%s\n" hello

Usage and sandbox support

The sandbox supports these basic formats and does not support loop formatting or width control.

Hands-on exercises

Full documentation ↗

Related commands