Using symbolic mode and changing no other permission bits, type the command that adds the execute permission for all three permission classes (user, group and other) to the file backup.sh in the current directory.
LPIC-1 Exam 102-500, objective 105. Shells and shell scripting easy
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
Answer
Type the answer.
Accepted answers
chmod +x backup.shchmod a+x backup.shchmod ugo+x backup.sh
Case sensitive — Linux is, and grading LS as ls would teach a falsehood.
Why
Symbolic mode is WHO OPERATOR PERMISSION: `u`, `g`, `o` or `a` for who, `+`, `-` or `=` for the operator. `chmod +x file` with no who behaves like `a+x` except that bits set in the umask are left alone, whereas `a+x` sets all three unconditionally; `u+x` would grant execute to the owner only. Numeric mode such as `chmod 755` would also work but replaces every permission bit rather than adding one. Without the execute bit, `./backup.sh` fails with permission denied, although `bash backup.sh` still runs it because there bash, not the kernel, opens the file.
Where this comes from
- Cited
- LPI exam objective 105.2
- What it says
- Make a script executable.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 105 and space the ones you get wrong.