ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 219 - XK0-005 discussion

Report
Export

The group owner of the / home/ test directory would like to preserve all group permissions on files created in the directory. Which of the following commands should the group owner execute?

A.
chmod g+s /home/test
Answers
A.
chmod g+s /home/test
B.
chgrp test /home/test
Answers
B.
chgrp test /home/test
C.
chmod 777 /home/test
Answers
C.
chmod 777 /home/test
D.
chown ---hR test /home/test
Answers
D.
chown ---hR test /home/test
Suggested answer: A

Explanation:

The correct answer is

A) chmod g+s /home/test

This command will set the setgid bit on the /home/test directory, which means that any file or subdirectory created in the directory will inherit the group ownership of the directory. This way, the group permissions on files created in the directory will be preserved. The chmod command is used to change the permissions of files and directories. The g+s option is used to set the setgid bit for the group.

The other options are incorrect because:

B) chgrp test /home/test

This command will change the group ownership of the /home/test directory to test, but it will not affect the group ownership of files created in the directory. The chgrp command is used to change the group of files and directories. The test /home/test arguments are used to specify the new group and the target directory.

C) chmod 777 /home/test

This command will give read, write, and execute permissions to everyone (owner, group, and others) on the /home/test directory, but it will not affect the group ownership or permissions of files created in the directory. The chmod command is used to change the permissions of files and directories. The 777 argument is an octal number that represents the permissions in binary form.

D) chown -hR test /home/test

This command will change the owner and group of the /home/test directory and all its contents recursively to test, but it will not preserve the original group permissions on files created in the directory. The chown command is used to change the owner and group of files and directories. The -hR option is used to affect symbolic links and operate on all files and directories recursively. The test /home/test arguments are used to specify the new owner and group and the target directory.

How to Set File Permissions Using chmod

How to Use Chmod Command in Linux with Examples

How to Use Chown Command in Linux with Examples

[How to Use Chgrp Command in Linux with Examples]

asked 02/10/2024
Houshang Ardekani
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first