Bird
0
0

After executing chmod +x example.sh, what change will you observe in the output of ls -l example.sh?

medium📝 Command Output Q4 of 15
Bash Scripting - Basics
After executing chmod +x example.sh, what change will you observe in the output of ls -l example.sh?
AThe file size will increase.
BThe file permissions will include an 'x' indicating execute permission.
CThe file owner will change to root.
DThe file will be hidden from the directory listing.
Step-by-Step Solution
Solution:
  1. Step 1: Understand ls -l output

    The ls -l command shows file permissions in the first column.
  2. Step 2: Effect of chmod +x

    Adding execute permission adds 'x' to the permission string (e.g., -rwxr--r--).
  3. Step 3: Analyze options

    Only The file permissions will include an 'x' indicating execute permission. correctly describes the permission change.
    File size, owner, and visibility do not change.
  4. Final Answer:

    The file permissions will include an 'x' indicating execute permission. -> Option B
  5. Quick Check:

    Does execute permission show as 'x'? Yes [OK]
Quick Trick: Execute permission shows as 'x' in ls -l [OK]
Common Mistakes:
MISTAKES
  • Expecting file size or ownership to change
  • Confusing execute permission with hidden files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes