PRINTF(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’… PRINTF β€” NAME

printf β€” format and print data. That's it, that's the whole vibe: it takes a FORMAT, it takes your ARGUMENTS, and it makes them pretty (or at least correct). And yeah, bestie, this is the printf(1) page from the User Commands manual β€” the shell-tool version, not the C-library one. We'll get to that one later. πŸŽ€


✨ SYNOPSIS ✨

printf FORMAT [ARGUMENT]...
printf OPTION

🌸 DESCRIPTION 🌸

So here's the tea: you print your ARGUMENT(s) according to FORMAT. Or β€” plot twist β€” you just execute a straight-up OPTION instead. Both are valid, both are iconic, pick your fighter. 🫢

Quick little menu of the OPTION path, since it's living here in the DESCRIPTION for some reason:
  • --help β€” display this help and exit. Classic. No notes. πŸ’–
  • --version β€” output version information and exit. So you can flex which GNU coreutils you're running.

Okay, and now the main character: FORMAT. It controls the output exactly like it does in C printf. Here's every interpreted sequence, no gatekeeping, all of them: πŸ¦‹

  • \" β€” double quote
  • \\ β€” backslash
  • \a β€” alert (BEL)
  • \b β€” backspace
  • \c β€” produce no further output
  • \e β€” escape
  • \f β€” form feed
  • \n β€” new line
  • \r β€” carriage return
  • \t β€” horizontal tab
  • \v β€” vertical tab
  • \NNN β€” byte with octal value NNN (1 to 3 digits)
  • \xHH β€” byte with hexadecimal value HH (1 to 2 digits)
  • \uHHHH β€” Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits)
  • \UHHHHHHHH β€” Unicode character with hex value HHHHHHHH (8 digits)
  • %% β€” a single %
  • %b β€” ARGUMENT as a string with \ escapes interpreted, except that octal escapes should have a leading 0 like \0NNN
  • %q β€” ARGUMENT is printed in a format that can be reused as shell input, escaping non-printable characters with the POSIX $'' syntax

And literally all C format specifications ending with one of diouxXfeEgGcs, with ARGUMENTs converted to proper type first. Variable widths? Handled. Slay. πŸ‘‘

Heads up though, bestie: your shell may have its own version of printf, which usually supersedes the version described here. That's not a bug, that's just how shells are. Please refer to your shell's documentation for details about the options it supports, because this page isn't the boss of it. πŸ’€

πŸŽ€ AUTHOR πŸŽ€

Written by David MacKenzie. We stan a legend. 🌈


πŸ› REPORTING BUGS πŸ›

Found something cursed? Tell the people β€” they do want to know:


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’– THE SIGN-OFF πŸ’–

So basically, this whole page came to you courtesy of GNU coreutils 9.10, dated August 2026, and it's the PRINTF(1) page of the User Commands manual β€” Packaged by Ubuntu (9.10-1ubuntu2).

Copyright Β© 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

fr fr, no warranty, so manifest carefully bestie 😭✨
πŸ“¦ where this page comes from