nerdexam
LPI

010-100 · Question #4

Which TWO commands can be used to make the file /tmp/foo.txt readable for all users?

The correct answer is B. chmod 444 /tmp/foo.txt D. chmod 644 /tmp/foo.txt. For a file to be readable by all users, the read bit must be set for owner, group, and others. chmod 444 and chmod 644 both satisfy this requirement.

Configuration

Question

Which TWO commands can be used to make the file /tmp/foo.txt readable for all users?

Options

  • Achmod 111 /tmp/foo.txt
  • Bchmod 444 /tmp/foo.txt
  • Cchmod 770 /tmp/foo.txt
  • Dchmod 644 /tmp/foo.txt
  • Echmod 640 /tmp/foo.txt

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    79% (22)
  • C
    4% (1)
  • E
    11% (3)

Why each option

For a file to be readable by all users, the read bit must be set for owner, group, and others. chmod 444 and chmod 644 both satisfy this requirement.

Achmod 111 /tmp/foo.txt

chmod 111 sets --x--x--x, which grants only execute permission to all users and no read permission to anyone.

Bchmod 444 /tmp/foo.txtCorrect

chmod 444 sets permissions to r--r--r--, granting read-only access to the owner, group, and all other users, making the file universally readable.

Cchmod 770 /tmp/foo.txt

chmod 770 sets rwxrwx---, which grants no permissions to others, so users outside the owner and group cannot read the file.

Dchmod 644 /tmp/foo.txtCorrect

chmod 644 sets permissions to rw-r--r--, giving the owner read and write access while granting read-only access to group and others, so all users can read the file.

Echmod 640 /tmp/foo.txt

chmod 640 sets rw-r-----, which grants no permissions to others, so users outside the owner's group cannot read the file.

Concept tested: Linux chmod octal permissions for universal file readability

Source: https://man7.org/linux/man-pages/man1/chmod.1.html

Topics

#chmod#file permissions#octal notation#Linux permissions

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice