1PRINTF(1) User Commands PRINTF(1)
2
3
4
6 printf - format and print data
7
9 printf FORMAT [ARGUMENT]...
10 printf OPTION
11
13 Print ARGUMENT(s) according to FORMAT, or execute according to OPTION:
14
15 --help display this help and exit
16
17 --version
18 output version information and exit
19
20 FORMAT controls the output as in C printf. Interpreted sequences are:
21
22 \" double quote
23
24 \\ backslash
25
26 \a alert (BEL)
27
28 \b backspace
29
30 \c produce no further output
31
32 \e escape
33
34 \f form feed
35
36 \n new line
37
38 \r carriage return
39
40 \t horizontal tab
41
42 \v vertical tab
43
44 \NNN byte with octal value NNN (1 to 3 digits)
45
46 \xHH byte with hexadecimal value HH (1 to 2 digits)
47
48 \uHHHH Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits)
49
50 \UHHHHHHHH
51 Unicode character with hex value HHHHHHHH (8 digits)
52
53 %% a single %
54
55 %b ARGUMENT as a string with '\' escapes interpreted, except that
56 octal escapes are of the form \0 or \0NNN
57
58 %q ARGUMENT is printed in a format that can be reused as shell
59 input, escaping non-printable characters with the proposed POSIX
60 $'' syntax.
61
62 and all C format specifications ending with one of diouxXfeEgGcs, with
63 ARGUMENTs converted to proper type first. Variable widths are handled.
64
65 NOTE: your shell may have its own version of printf, which usually
66 supersedes the version described here. Please refer to your shell's
67 documentation for details about the options it supports.
68
70 Written by David MacKenzie.
71
73 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
74 Report printf translation bugs to <https://translationpro‐
75 ject.org/team/>
76
78 Copyright © 2018 Free Software Foundation, Inc. License GPLv3+: GNU
79 GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
80 This is free software: you are free to change and redistribute it.
81 There is NO WARRANTY, to the extent permitted by law.
82
84 printf(3)
85
86 Full documentation at: <https://www.gnu.org/software/coreutils/printf>
87 or available locally via: info '(coreutils) printf invocation'
88
89
90
91GNU coreutils 8.30 July 2018 PRINTF(1)