Formatted output with precise control over text, numbers, and layout.
printf prints formatted output using format strings. It is more predictable than echo and preferred in scripts.
printf "Hello\n" printf "%s %d\n" name 42
# Columns printf "%-10s %5d\n" item 10 # Floating point printf "%.2f\n" 3.14159 # Hex printf "%x\n" 255