UNIX MCQs – Permissions and Ownership (Part – 2)

UNIX Question and Answer – Permissions and Ownership

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. Which command is used to recursively change the permissions of a directory and its contents in UNIX?

a) chmod -R

b) chmod -r

c) chmod -F

d) chmod -f

Answer: a) chmod -R

Explanation: The chmod -R command is used to recursively change the permissions of a directory and its contents in UNIX.


2. In UNIX, what does the “chmod 1777” command do?

a) Sets the setuid, setgid, and sticky bit on a file

b) Sets the setuid and setgid bits on a file

c) Sets the sticky bit on a file

d) Sets the setuid bit on a file

Answer: a) Sets the setuid, setgid, and sticky bit on a file

Explanation: The command “chmod 1777” sets the setuid, setgid, and sticky bit on a file in UNIX.


3. Which command is used to recursively change the ownership of a directory and its contents in UNIX?

a) chown -R

b) chown -r

c) chown -F

d) chown -f

Answer: a) chown -R

Explanation: The chown -R command is used to recursively change the ownership of a directory and its contents in UNIX.


4. In UNIX, what does the “chown user:group file.txt” command do?

a) Changes the owner of the file to ‘user’ and the group to ‘group’

b) Changes the owner of the file to ‘group’ and the group to ‘user’

c) Changes the owner of the file to ‘user’ and adds ‘group’ to the supplementary groups

d) Changes the owner of the file to ‘group’ and adds ‘user’ to the supplementary groups

Answer: a) Changes the owner of the file to ‘user’ and the group to ‘group’

Explanation: The command “chown user:group file.txt” changes the owner of the file to ‘user’ and the group to ‘group’ in UNIX.


5. Which command is used to recursively change the group ownership of a directory and its contents in UNIX?

a) chgrp -R

b) chgrp -r

c) chgrp -F

d) chgrp -f

Answer: a) chgrp -R

Explanation: The chgrp -R command is used to recursively change the group ownership of a directory and its contents in UNIX.


6. In UNIX, what does the “chgrp group file.txt” command do?

a) Changes the owner of the file to ‘group’

b) Changes the group ownership of the file to ‘group’

c) Adds ‘group’ to the supplementary groups of the file

d) Changes the group ownership of the file to ‘group’ and adds ‘group’ to the supplementary groups

Answer: b) Changes the group ownership of the file to ‘group’

Explanation: The command “chgrp group file.txt” changes the group ownership of the file to ‘group’ in UNIX.


7. Which command is used to recursively remove the setuid permission from a directory and its contents in UNIX?

a) chmod -R -s

b) chmod -R u-s

c) chmod -R +s

d) chmod -R u+s

Answer: b) chmod -R u-s

Explanation: The chmod -R u-s command is used to recursively remove the setuid permission from a directory and its contents in UNIX.


8. In UNIX, what does the “chmod 644” command do?

a) Grants read and write permissions to the owner and read-only permissions to the group and others

b) Grants read and write permissions to the owner and the group, and no permissions to others

c) Grants full permissions to the owner and read-only permissions to the group and others

d) Grants read and write permissions to the owner and read-only permissions to the group

Answer: a) Grants read and write permissions to the owner and read-only permissions to the group and others

Explanation: The command “chmod 644” grants read and write permissions to the owner and read-only permissions to the group and others in UNIX.


9. Which command is used to recursively remove the setgid permission from a directory and its contents in UNIX?

a) chmod -R -s

b) chmod -R g-s

c) chmod -R +s

d) chmod -R g+s

Answer: b) chmod -R g-s

Explanation: The chmod -R g-s command is used to recursively remove the setgid permission from a directory and its contents in UNIX.


10. In UNIX, what does the “chmod 1777” command do?

a) Grants read, write, and execute permissions to the owner and group, and read-only permissions to others

b) Grants read, write, and execute permissions to the owner and group, and grants read and execute permissions to others with the sticky bit set

c) Grants read, write, and execute permissions to the owner and group, and grants read and execute permissions to others with the sticky bit set

d) Grants read, write, and execute permissions to the owner and group, and no permissions to others with the sticky bit set

Answer: b) Grants read, write, and execute permissions to the owner and group, and grants read and execute permissions to others with the sticky bit set

Explanation: The command “chmod 1777” grants read, write, and execute permissions to the owner and group, and grants read and execute permissions to others with the sticky bit set in UNIX.


11. Which command is used to recursively remove the sticky bit from a directory and its contents in UNIX?

a) chmod -R -t

b) chmod -R +t

c) chmod -R -s

d) chmod -R +s

Answer: a) chmod -R -t

Explanation: The chmod -R -t command is used to recursively remove the sticky bit from a directory and its contents in UNIX.


12. In UNIX, what does the “chmod 755” command do?

a) Grants full permissions to the owner, read and execute permissions to the group, and read-only permissions to others

b) Grants read and write permissions to the owner, and read-only permissions to the group and others

c) Grants full permissions to the owner and the group, and read-only permissions to others

d) Grants read and write permissions to the owner and the group, and no permissions to others

Answer: a) Grants full permissions to the owner, read and execute permissions to the group, and read-only permissions to others

Explanation: The command “chmod 755” grants full permissions to the owner, read and execute permissions to the group, and read-only permissions to others in UNIX.


13. Which command is used to recursively remove the sticky bit from a file and its contents in UNIX?

a) chmod -R -t

b) chmod -R +t

c) chmod -R -s

d) chmod -R +s

Answer: c) chmod -R -s

Explanation: The chmod -R -s command is used to recursively remove the sticky bit from a file and its contents in UNIX.


14. In UNIX, what does the “chmod 600” command do?

a) Grants full permissions to the owner and no permissions to the group and others

b) Grants read and write permissions to the owner and no permissions to the group and others

c) Grants full permissions to the owner, read-only permissions to the group, and no permissions to others

d) Grants read and write permissions to the owner and the group, and no permissions to others

Answer: a) Grants full permissions to the owner and no permissions to the group and others

Explanation: The command “chmod 600” grants full permissions to the owner and no permissions to the group and others in UNIX.


15. Which command is used to recursively remove the setuid and setgid permissions from a directory and its contents in UNIX?

a) chmod -R -s

b) chmod -R u-s,g-s

c) chmod -R +s

d) chmod -R u+s,g+s

Answer: b) chmod -R u-s,g-s

Explanation: The chmod -R u-s,g-s command is used to recursively remove the setuid and setgid permissions from a directory and its contents in UNIX.


16. In UNIX, what does the “chmod 777” command do?

a) Grants full permissions to the owner, the group, and others

b) Grants read, write, and execute permissions to the owner, the group, and others

c) Grants read and write permissions to the owner, the group, and others

d) Grants read, write, and execute permissions to the owner and the group, and read-only permissions to others

Answer: b) Grants read, write, and execute permissions to the owner, the group, and others

Explanation: The command “chmod 777” grants read, write, and execute permissions to the owner, the group, and others in UNIX.


17. Which command is used to recursively remove all permissions from a directory and its contents in UNIX?

a) chmod -R 000

b) chmod -R 777

c) chmod -R 666

d) chmod -R 444

Answer: a) chmod -R 000

Explanation: The chmod -R 000 command is used to recursively remove all permissions from a directory and its contents in UNIX.


18. In UNIX, what does the “chmod 644” command do?

a) Grants full permissions to the owner and read-only permissions to the group and others

b) Grants read and write permissions to the owner and read-only permissions to the group and others

c) Grants full permissions to the owner, the group, and others

d) Grants read, write, and execute permissions to the owner and the group, and no permissions to others

Answer: a) Grants full permissions to the owner and read-only permissions to the group and others

Explanation: The command “chmod 644” grants full permissions to the owner and read-only permissions to the group and others in UNIX.


19. Which command is used to recursively remove read and execute permissions from a directory and its contents in UNIX?

a) chmod -R u-rx

b) chmod -R u+rx

c) chmod -R u-r

d) chmod -R u+rw

Answer: a) chmod -R u-rx

Explanation: The chmod -R u-rx command is used to recursively remove read and execute permissions from a directory and its contents in UNIX.


20. In UNIX, what does the “chmod 700” command do?

a) Grants full permissions to the owner and no permissions to the group and others

b) Grants read and write permissions to the owner and no permissions to the group and others

c) Grants full permissions to the owner, read-only permissions to the group, and no permissions to others

d) Grants read and write permissions to the owner and the group, and no permissions to others

Answer: a) Grants full permissions to the owner and no permissions to the group and others

Explanation: The command “chmod 700” grants full permissions to the owner and no permissions to the group and others in UNIX.


21. Which command is used to recursively remove write and execute permissions from a directory and its contents in UNIX?

a) chmod -R u-wx

b) chmod -R u+wx

c) chmod -R u-w

d) chmod -R u+x

Answer: a) chmod -R u-wx

Explanation: The chmod -R u-wx command is used to recursively remove write and execute permissions from a directory and its contents in UNIX.


22. In UNIX, what does the “chmod 750” command do?

a) Grants read, write, and execute permissions to the owner and the group, and no permissions to others

b) Grants read and write permissions to the owner, and read-only permissions to the group and others

c) Grants full permissions to the owner and read-only permissions to the group and others

d) Grants read and write permissions to the owner and the group, and execute permissions to others

Answer: a) Grants read, write, and execute permissions to the owner and the group, and no permissions to others

Explanation: The command “chmod 750” grants read, write, and execute permissions to the owner and the group, and no permissions to others in UNIX.


23. Which command is used to recursively remove read and write permissions from a directory and its contents in UNIX?

a) chmod -R u-rw

b) chmod -R u+rw

c) chmod -R u-r

d) chmod -R u+w

Answer: a) chmod -R u-rw

Explanation: The chmod -R u-rw command is used to recursively remove read and write permissions from a directory and its contents in UNIX.


24. In UNIX, what does the “chmod 711” command do?

a) Grants read, write, and execute permissions to the owner, and execute permissions to the group and others

b) Grants full permissions to the owner and read-only permissions to the group and others

c) Grants read and write permissions to the owner and the group, and execute permissions to others

d) Grants read, write, and execute permissions to the owner, and read-only permissions to the group and others

Answer: a) Grants read, write, and execute permissions to the owner, and execute permissions to the group and others

Explanation: The command “chmod 711” grants read, write, and execute permissions to the owner, and execute permissions to the group and others in UNIX.


25. Which command is used to recursively remove read and execute permissions from a directory and its contents in UNIX?

a) chmod -R u-rx

b) chmod -R u+rx

c) chmod -R u-r

d) chmod -R u+x

Answer: a) chmod -R u-rx

Explanation: The chmod -R u-rx command is used to recursively remove read and execute permissions from a directory and its contents in UNIX.


26. Which command is used to change the owner of a symbolic link in UNIX?

a) chown

b) chgrp

c) chown -h

d) chgrp -h

Answer: c) chown -h

Explanation: The chown -h command is used to change the owner of a symbolic link in UNIX.


27. In UNIX, what is the default group ownership of a file created by a user?

a) The user’s primary group

b) The user’s supplementary groups

c) The root group

d) The wheel group

Answer: a) The user’s primary group

Explanation: By default, a file created by a user is assigned to the user’s primary group.


28. Which command is used to change the group ownership of a symbolic link in UNIX?

a) chgrp

b) chown

c) chgrp -h

d) chown -h

Answer: c) chgrp -h

Explanation: The chgrp -h command is used to change the group ownership of a symbolic link in UNIX.


29. In UNIX, what does the command “chown :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the group ownership of the file to the group specified by ‘group’

Answer: b) Changes the group ownership of the file to ‘:group’

Explanation: The command “chown :group file.txt” changes the group ownership of the file to ‘:group’ in UNIX.


30. Which command is used to change both the owner and group of a symbolic link simultaneously in UNIX?

a) chown

b) chgrp

c) chown -h

d) chgrp -h

Answer: c) chown -h

Explanation: The chown -h command is used to change both the owner and group of a symbolic link simultaneously in UNIX.


31. In UNIX, what does the command “chgrp group file.txt” do?

a) Changes the owner of the file to ‘group’

b) Changes the group ownership of the file to ‘group’

c) Adds ‘group’ to the supplementary groups of the file

d) Changes the group ownership of the file to the group specified by ‘group’

Answer: b) Changes the group ownership of the file to ‘group’

Explanation: The command “chgrp group file.txt” changes the group ownership of the file to ‘group’ in UNIX.


32. Which command is used to change the owner and group of a file or directory in UNIX?

a) chown

b) chgrp

c) chmod

d) chmod +s

Answer: a) chown

Explanation: The chown command is used to change the owner and group of a file or directory in UNIX.


33. In UNIX, what does the command “chown user file.txt” do?

a) Changes the owner of the file to ‘user’

b) Changes the group ownership of the file to ‘user’

c) Adds ‘user’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘user’

Answer: a) Changes the owner of the file to ‘user’

Explanation: The command “chown user file.txt” changes the owner of the file to ‘user’ in UNIX.


34. Which command is used to change the group ownership of a file or directory in UNIX?

a) chgrp

b) chown

c) chmod

d) chmod +s

Answer: a) chgrp

Explanation: The chgrp command is used to change the group ownership of a file or directory in UNIX.


35. In UNIX, what does the command “chown :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘:group’

Answer: b) Changes the group ownership of the file to ‘:group’

Explanation: The command “chown :group file.txt” changes the group ownership of the file to ‘:group’ in UNIX.


36. Which command is used to change the owner and group of a symbolic link in UNIX?

a) chown

b) chgrp

c) chown -h

d) chgrp -h

Answer: c) chown -h

Explanation: The chown -h command is used to change the owner and group of a symbolic link in UNIX.


37. In UNIX, what does the command “chgrp :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the group ownership of the file to the group specified by ‘:group’

Answer: d) Changes the group ownership of the file to the group specified by ‘:group’

Explanation: The command “chgrp :group file.txt” changes the group ownership of the file to the group specified by ‘:group’ in UNIX.


38. Which command is used to change the owner and group of a file or directory in UNIX?

a) chown

b) chgrp

c) chmod

d) chmod +s

Answer: a) chown

Explanation: The chown command is used to change the owner and group of a file or directory in UNIX.


39. In UNIX, what does the command “chgrp group file.txt” do?

a) Changes the owner of the file to ‘group’

b) Changes the group ownership of the file to ‘group’

c) Adds ‘group’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘group’

Answer: b) Changes the group ownership of the file to ‘group’

Explanation: The command “chgrp group file.txt” changes the group ownership of the file to ‘group’ in UNIX.


40. Which command is used to change the group ownership of a file or directory in UNIX?

a) chgrp

b) chown

c) chmod

d) chmod +s

Answer: a) chgrp

Explanation: The chgrp command is used to change the group ownership of a file or directory in UNIX.


41. In UNIX, what does the command “chown :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘:group’

Answer: b) Changes the group ownership of the file to ‘:group’

Explanation: The command “chown :group file.txt” changes the group ownership of the file to ‘:group’ in UNIX.


42. Which command is used to change the owner and group of a symbolic link in UNIX?

a) chown

b) chgrp

c) chown -h

d) chgrp -h

Answer: c) chown -h

Explanation: The chown -h command is used to change the owner and group of a symbolic link in UNIX.


43. In UNIX, what does the command “chgrp :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the group ownership of the file to the group specified by ‘:group’

Answer: d) Changes the group ownership of the file to the group specified by ‘:group’

Explanation: The command “chgrp :group file.txt” changes the group ownership of the file to the group specified by ‘:group’ in UNIX.


44. Which command is used to change the owner and group of a file or directory in UNIX?

a) chown

b) chgrp

c) chmod

d) chmod +s

Answer: a) chown

Explanation: The chown command is used to change the owner and group of a file or directory in UNIX.


45. In UNIX, what does the command “chgrp group file.txt” do?

a) Changes the owner of the file to ‘group’

b) Changes the group ownership of the file to ‘group’

c) Adds ‘group’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘group’

Answer: b) Changes the group ownership of the file to ‘group’

Explanation: The command “chgrp group file.txt” changes the group ownership of the file to ‘group’ in UNIX.


46. Which command is used to change the group ownership of a file or directory in UNIX?

a) chgrp

b) chown

c) chmod

d) chmod +s

Answer: a) chgrp

Explanation: The chgrp command is used to change the group ownership of a file or directory in UNIX.


47. In UNIX, what does the command “chown :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the owner and group of the file to ‘:group’

Answer: b) Changes the group ownership of the file to ‘:group’

Explanation: The command “chown :group file.txt” changes the group ownership of the file to ‘:group’ in UNIX.


48. Which command is used to change the owner and group of a symbolic link in UNIX?

a) chown

b) chgrp

c) chown -h

d) chgrp -h

Answer: c) chown -h

Explanation: The chown -h command is used to change the owner and group of a symbolic link in UNIX.


49. In UNIX, what does the command “chgrp :group file.txt” do?

a) Changes the owner of the file to ‘:group’

b) Changes the group ownership of the file to ‘:group’

c) Adds ‘:group’ to the supplementary groups of the file

d) Changes the group ownership of the file to the group specified by ‘:group’

Answer: d) Changes the group ownership of the file to the group specified by ‘:group’

Explanation: The command “chgrp :group file.txt” changes the group ownership of the file to the group specified by ‘:group’ in UNIX.


50. Which command is used to change the owner and group of a file or directory in UNIX?

a) chown

b) chgrp

c) chmod

d) chmod +s

Answer: a) chown

Explanation: The chown command is used to change the owner and group of a file or directory in UNIX.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...