Skip to content

printf command on Linux (formats data)

The printf command in Linux formats and prints data. It is generally used in small scripts and follows the FORMAT pattern followed by ARGUMENTS.

The ARGUMENTS are inserted in the text in the format indicated.

Example:

$ printf “My name is %s. nPleased to meet you. n” “Uira” <br></br>My name is Uira. <br></br>Pleased to meet you.

printf allows in-text substitutions with an informed argument. In this case, the variable %s is replaced with the argument “Will Run”.

Learn much more about Linux in our online course. You can register 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