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

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"

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




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




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |