Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#tr
#character-deletion
#case-sensitivity
#vowel-removal
#echo
Medio

What is the output of the following command?

echo "Hello World" | tr -d aieou

A

Hello World

B

eoo

C

Hll Wrld

Correcto
D

eoo Hll Wrld

Explicación Oficial / Explicaciones de la Comunidad

The tr command is used to translate or delete characters. With the -d option, it deletes specified characters from the input. In this case, tr -d aieou deletes all occurrences of the vowels 'a', 'i', 'e', 'o', and 'u' from the input string "Hello World". Note that the command is case-sensitive, so it only deletes lowercase vowels; uppercase 'W' and 'H' are not affected. The output becomes "Hll Wrld" because the 'e' and 'o' in "Hello" are removed, and the 'o' in "World" is removed, leaving a space between "Hll" and "Wrld". The incorrect outputs: "Hello World" would result if no deletion occurred; "eoo" would be the result if only vowels were kept (using -c complement); "eoo Hll Wrld" would be a mix of kept and deleted characters, which is not produced by this command.