Bootstrap FreeKB - Linux Commands - printf (print output)
Linux Commands - printf (print output)

Updated:   |  Linux Commands articles

The printf and echo commands are used to print text. In this example, the printf command is used to print Hello World.

printf "Hello World"

 


new lines

By default, the printf command will not include a new line at the end of a string, whereas by default, the echo command will include a new line at the end of a string. The \n regular expression can be used to include a new line at the end of a string.

printf "Hello World\n"

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter ddf7e3 in the box below so that we can be sure you are a human.