cmdxray / commands / printf

What does printf do?

format and print data using a printf-style template.

▸ Explain your own printf command →

printf examples, explained

$ printf '%s\n' hello

  • printfformat and print data using a printf-style template
  • %s\nan argument passed to the command
  • helloan argument passed to the command

$ printf "%-10s %d\n" name 42

  • printfformat and print data using a printf-style template
  • %-10s %d\nan argument passed to the command
  • namean argument passed to the command
  • 42an argument passed to the command

printf flags & options

-vstore the output in a shell variable instead of printing it

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.