oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


printf formats [strings] printf option

Print strings using the specified formats. formats can be ordinary text characters, C-language escape characters, C format specifications ending with one of the letters diouxXfeEgGcs or, more commonly, a set of conversion arguments listed here.



Print usage information and exit.


Print version information and exit.



Print a single %.


Print string with \ escapes interpreted.


Print the next string.


Print the nth string.

%[-] m[.n] s

Print the next string, using a field that is m characters wide. Optionally, limit the field to print only the first n characters of string. Strings are right-adjusted unless the left-adjustment flag, -, is specified.


printf '%s %s\n' "My files are in" $HOME printf '%-25.15s %s\n' "My files are in" $HOME

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: