The printf command formats and outputs the results to standard output.
1 . Command format:
printf (options) (parameters)
2 . Command function:
Echo will send the input string to standard output. The output strings are separated by white space characters, and a newline number is added at the end.
3 . Command parameters:
Format alternates
%b???????????? The corresponding parameter is treated as a string containing the escape sequence to be processed.
%c???????????? ASCII characters. Display the first character of a relative parameter
%d,%i???????? Decimal integer
%e,%e,%f???? Floating-point format
%g%e or%f???? Convert, see which one is shorter, then delete the end of the 0
%G%e or%f???? Convert, see which one is shorter, then delete the end of the 0
%o???????????? Octal value with unsigned sign
%s???????????? String
%u???????????? Decimal value with no sign
%x???????????? Unsigned hexadecimal value, using a to F for 10 to 15
%x???????????? Unsigned hexadecimal value, using a to F for 10 to 15
%% ???????????? Literal meaning of the%
?
Escape sequences
\a???????????? A warning character, usually an ASCII bel character
\b???????????? Back off
\c???????????? Suppresses (does not display) the newline character at any end of the output (only valid in the parameter string under the control of the%b format designator), and any characters left in the argument, any subsequent arguments, and any characters left in the format string are ignored
\f???????????? Page Change (formfeed)
\ n???????????? Line break
\ r???????????? Enter (carriage return)
\ t???????????? Horizontal tab
\v???????????? Vertical tab
\\ ???????????? A literal backslash character
\DDD???????? A character representing a 1 to 3-digit octal value that is valid only in a format string
\0DDD???????? Represents octal value characters from 1 to 3 bits
4 . Usage Examples:
?
Linux command detailed-printf