printf Formatting Codes n %b—Expands backslash sequences n %c—Displays a single character n %d—Displays a signed number n %e—Displays a floating-point number, exponential (also called scientific) notation n %f—Displays a floating-point number n %g—Uses %f or %e depending on the value n %i—Same as %d n %o—Displays an n %q—Quotes the n %s—Displays an n %u—Displays an n %x—Displays an n %X—Displays an n %%—Displays a percent sign octal number string so it can be read properly by a shell script unquoted string unsigned number unsigned hexadecimal number, using lowercase letters unsigned hexadecimal number, using uppercase letters printf Backslash Codes n \b—Backspace n \f—Form feed (that is, eject a page on a printer) Reference Section 47 48 Chapter 3 Files, Users, and Shell Customization n \n—Start a new line n \r—Carriage return n \t—Tab n \v—Vertical tab n \’—Single quote character (for compatibility with C) n \\—Backslash n \0n—n is an octal number representing an 8-bit ASCII character