RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


Which command will add the execute permission for everyone to a file named file5?

  1. chmod u-rwx file5

  2. chmod a+x file5

  3. chmod u+r,g+w+w,o+x file2

  4. none of the above

The correct answer is: chmod a+x file5

The command to add execute permission for everyone to a file named file5 is indeed "chmod a+x file5". In the context of the `chmod` command, the 'a' in 'a+x' stands for "all", which includes the user (owner), group, and others. The '+x' indicates that execute permission is being added. When you use this command, it modifies the file permissions so that all users (regardless of their ownership or group affiliation) can execute the file. This is particularly important for scripts or executables that need to be run by multiple users in a system. The other commands provided do not achieve this objective. One command removes read, write, and execute permissions from the user, which would be counterproductive. Another command attempts to add different permissions for user, group, and others but does not specifically add execute permission for all. Therefore, the command that adds execute permission for everyone to file5 is the most appropriate and effective choice.