printf '%s\n' item1 item2

Category: Shell & Bash

printf '%s\n' item1 item2

Print formatted output, safer than echo for special chars

Prints formatted output. Unlike echo, printf gives you precise control over formatting and handles special characters safely.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.