printf Command in Linux: Format and Print Data in Shell Scripts
Linuxcommands
The printf command in Linux formats and prints data. It is commonly used in small scripts and follows the FORMAT followed by ARGUMENTS pattern.
The ARGUMENTS are inserted into the text in the specified FORMAT.
Example:
$ printf "Meu nome é %s.\nPrazer em conhece-lo.\n" "Uirá"Meu nome é Uirá.Prazer em conhece-lo.
Printf allows substitutions in the text, with a provided argument. In this case, the variable %s is replaced by the argument "Uirá".
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.