What command would display "hello world" followed by a new line in a script?

Prepare for the LPI Linux Essentials Exam. Study with flashcards and multiple choice questions, each with hints and explanations. Get exam-ready!

The command that would display "hello world" followed by a new line in a script is the one that specifically uses the echo command. The echo command is a built-in shell command in many Unix-like operating systems, including Linux, used to output text or variables to the terminal. When you run the command echo "hello world", it sends the string "hello world" to the standard output, followed by a new line by default.

This functionality makes echo a common choice for providing textual output in scripts, making it easy to communicate messages or display the results of script operations. In shell scripting, the newline character automatically follows the output, allowing for clean console output.

Other commands provided do not serve this specific purpose in shell scripts: print, display, and write are not standard shell commands for outputting text in the same way that echo is. Therefore, among the options provided, using echo is the correct method to achieve the desired output.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy