exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 202 discussion

Actual exam question from CompTIA's XK0-004
Question #: 202
Topic #: 1
[All XK0-004 Questions]

A Linux user wants to give read-only permissions to a directory and its contents. Which of the following commands will allow the user to accomplish this task?

  • A. chmod ג€"R 400 /new_directory/
  • B. chmod ג€"R 600 /new_directory/
  • C. chmod 400 /new_directory/
  • D. chmod 600 /new_directory/
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Vegito24
Highly Voted 4 years, 4 months ago
Shouldn't this be A? Read only would be 400 and - R will do the directory and its contents.
upvoted 18 times
...
alfre
Highly Voted 4 years, 4 months ago
A. chmod -R 400 /new_directory/
upvoted 9 times
...
luken7777
Most Recent 1 year, 9 months ago
This question is absolutely stupid, because if you type chmod -R 400 /new_directory/ then it will remove execute permission making this directory and its content inaccessible
upvoted 1 times
...
RichardJRL
3 years ago
Selected Answer: A
A. The operation is to be applied to the dir and its contents, so -R is required. Read only access implies 400 permissions.
upvoted 3 times
...
Dan_Dan_The_Data_Center_Man
3 years, 5 months ago
Correct Answer: A. chmod ג€"R 400 /new_directory/ The key is a "directory and its contents" chmod Modifies File Permissions -R Change files and directories recursively. Read only would be 400
upvoted 3 times
...
Ty_G_S
3 years, 9 months ago
A is the answer. Read = 4, Write = 2, Execute = 1 Therefore the directory would need to be 400 and need to be recursive with the -R option. Reference: https://linuxize.com/post/chmod-command-in-linux/
upvoted 5 times
...
jahute27
4 years, 4 months ago
Yes you guys are right A is the answer. https://www.computerhope.com/unix/uchmod.htm
upvoted 5 times
...
jahute27
4 years, 4 months ago
I think it should be C https://ldapwiki.com/wiki/Examples%20Using%20chmod#:~:text=chmod%20400%20myfile%20%2D%20Gives%20the,the%20third%20is%20for%20other.
upvoted 3 times
Mas511
3 years, 6 months ago
You need the -R option to apply it to the directory contents. Thus, is A.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago