Bird
0
0

What is the primary purpose of the tr command in bash scripting?

easy🧠 Conceptual Q1 of 15
Bash Scripting - Text Processing in Scripts
What is the primary purpose of the tr command in bash scripting?
ATo translate or delete characters from input
BTo list files in a directory
CTo compile source code
DTo create new directories
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of tr

    The tr command is used to translate or delete characters from standard input.
  2. Step 2: Compare with other options

    Listing files, compiling code, and creating directories are unrelated to tr.
  3. Final Answer:

    To translate or delete characters from input -> Option A
  4. Quick Check:

    Purpose of tr = translate/delete characters [OK]
Quick Trick: Remember: tr changes or removes characters [OK]
Common Mistakes:
MISTAKES
  • Confusing tr with ls or mkdir
  • Thinking tr compiles code
  • Assuming tr lists files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes