Bird
0
0

Which logical operator in bash scripting means AND when used inside [ ]?

easy🧠 Conceptual Q11 of 15
Bash Scripting - Conditionals
Which logical operator in bash scripting means AND when used inside [ ]?
A&&
B-o
C!
D-a
Step-by-Step Solution
Solution:
  1. Step 1: Understand bash logical operators inside [ ]

    Inside single brackets, -a means AND, -o means OR, and ! means NOT.
  2. Step 2: Identify the AND operator

    The operator -a is used to combine two conditions with AND logic.
  3. Final Answer:

    -a -> Option D
  4. Quick Check:

    AND operator = -a [OK]
Quick Trick: Remember: -a is AND, -o is OR, ! is NOT inside [ ] [OK]
Common Mistakes:
MISTAKES
  • Confusing -a with -o
  • Using && inside [ ] which is invalid
  • Thinking ! means AND

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes