PRINTF(1)
π 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 leading0like\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:
- Report bugs to:
bug-coreutils@gnu.org - GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
- Report any translation bugs to <https://translationproject.org/team/>
π¦ SEE ALSO π¦
printf(3)β yes, the C-library one, the sibling, the origin story π- Full documentation <https://www.gnu.org/software/coreutils/printf>, or available locally via:
info '(coreutils) printf invocation'
π 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
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms