nerdexam
Linux_Foundation

LFCS · Question #663

Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)

The correct answer is B. chmod +t /tmp C. chmod 1775 /tmp. To set the sticky bit for a directory, you can use either the symbolic mode +t or the octal mode 1xxx where xxx represents the base permissions.

Submitted by takeshi77· Apr 18, 2026Essential Commands

Question

Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)

Options

  • Achmod +s /tmp
  • Bchmod +t /tmp
  • Cchmod 1775 /tmp
  • Dchmod 4775 /tmp
  • Echmod 2775 /tmp

How the community answered

(48 responses)
  • A
    2% (1)
  • B
    90% (43)
  • D
    2% (1)
  • E
    6% (3)

Why each option

To set the sticky bit for a directory, you can use either the symbolic mode `+t` or the octal mode `1xxx` where `xxx` represents the base permissions.

Achmod +s /tmp

The `chmod +s /tmp` command sets the SetUID or SetGID bit, not the sticky bit.

Bchmod +t /tmpCorrect

The `chmod +t /tmp` command uses symbolic mode to explicitly add the sticky bit to the `/tmp` directory, preventing non-owners from deleting or renaming files they don't own within it.

Cchmod 1775 /tmpCorrect

The `chmod 1775 /tmp` command uses octal mode, where the leading `1` sets the sticky bit, and `775` specifies read, write, and execute permissions for the owner and group, and read and execute for others.

Dchmod 4775 /tmp

The `chmod 4775 /tmp` command sets the SetUID bit, indicated by the leading `4`, not the sticky bit.

Echmod 2775 /tmp

The `chmod 2775 /tmp` command sets the SetGID bit, indicated by the leading `2`, not the sticky bit.

Concept tested: Linux file permissions (sticky bit)

Source: https://linux.die.net/man/1/chmod

Topics

#chmod#sticky bit#file permissions#special permissions

Community Discussion

No community discussion yet for this question.

Full LFCS Practice