A system administrator needs to alter the permissions on a script file named daily_check.sh. The requirements are to add execute permission for the user (owner) and the group, while also removing write permission for the group. The permissions for "others" and the owner's existing read/write permissions must not be changed. Which of the following commands will achieve this in a single operation using symbolic notation?
The command chmod u+x,g+x-w daily_check.sh satisfies all requirements. In symbolic notation:
u+x adds execute (x) permission to the user (owner).
g+x-w first adds execute permission (+x) and then removes write permission (-w) for the group in a single symbolic clause. Because the clause is scoped to g, it does not affect user or others permissions.
No changes are made to the owner's read or write bits, and the permissions for "others" remain untouched.
Incorrect alternatives:
chmod a+x,g-w daily_check.sh - the a (all) specifier grants execute to others as well, violating the requirement.
chmod u+x,g-w daily_check.sh - removes write for the group but fails to grant execute to the group.
chmod u=rwx,g=rx daily_check.sh - the = operator sets those classes' permissions absolutely. This would grant write permission to the owner even if it was intentionally disabled before (and could clear special bits), contradicting the instruction to leave existing owner permissions unchanged.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `chmod u+x,g+x-w` command mean?
Open an interactive chat with Bash
What happens if you use `chmod a+x,g-w` instead?
Open an interactive chat with Bash
How does the `=` operator differ from `+` and `-` in chmod commands?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access