Bird
0
0

What will be the output of this command?

medium📝 Command Output Q5 of 15
Bash Scripting - Text Processing in Scripts
What will be the output of this command?
echo "Hello 2024" | tr -d '0-9'
AHll
BHello 2024
CHello
D2024
Step-by-Step Solution
Solution:
  1. Step 1: Understand the delete flag

    -d '0-9' deletes all digits from the input.
  2. Step 2: Apply deletion to input

    Digits "2024" are removed, leaving "Hello " with the space intact.
  3. Final Answer:

    Hello -> Option C
  4. Quick Check:

    Digits deleted, text remains = Hello [OK]
Quick Trick: Delete digits with -d '0-9' to keep letters and spaces [OK]
Common Mistakes:
MISTAKES
  • Expecting digits to remain
  • Deleting spaces accidentally
  • Output missing spaces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes