Linux Foundation Certified System Administrator LFCS Exam: Command Output - tr Command

Command Output of "echo "Hello World" | tr -d aieou"

Question

What is the output of the following command?

echo "Hello World" | tr -d aieou

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C

The command echo "Hello World" | tr -d aieou is composed of two parts.

The first part, echo "Hello World", simply prints the string "Hello World" to the console.

The second part, tr -d aieou, uses the tr command to remove any occurrences of the letters "a", "i", "e", "o", and "u" from its input. The option -d tells tr to delete these characters rather than replace them with something else.

When we combine these two parts using the pipe | symbol, the output of the echo command is passed as input to the tr command. The tr command then removes any occurrences of the specified letters from the input.

Therefore, the output of the entire command will be "Hll Wrld". The letters "a", "i", "e", "o", and "u" have been removed from "Hello World", leaving only the consonants. So the correct answer is C. Hll Wrld.