Bird
0
0

What will the following command output?

medium📝 Command Output Q5 of 15
Linux CLI - Linux Basics and Terminal
What will the following command output?
echo "Today is $(date +%A)"
AToday is +%A
BToday is $(date +%A)
CToday is Monday (or current weekday)
DError: command not found
Step-by-Step Solution
Solution:
  1. Step 1: Understand command substitution

    The syntax $(command) runs the command and inserts its output into the string.
  2. Step 2: Identify the output of date +%A

    This command outputs the full weekday name, e.g., Monday, Tuesday, etc.
  3. Final Answer:

    Today is Monday (or current weekday) -> Option C
  4. Quick Check:

    Command substitution = inserts command output [OK]
Quick Trick: Use $(command) to insert command output inside strings [OK]
Common Mistakes:
  • Not using $() for substitution
  • Expecting literal text
  • Misunderstanding date format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes