nerdexam
CompTIACompTIA

XK0-005 · Question #1253

XK0-005 Question #1253: Real Exam Question with Answer & Explanation

The correct answer is C: umask 2002. The error "Octal number out of range" occurs because the umask command expects a valid octal number between 0 and 777. The value 2002 is outside this valid range for setting file permissions.

System Management

Question

The following represents a partial listing of a user's .bashrc file: HISTSIZE=800 HISTFILESIZE=1000 umask 2002 HISTCONTROL=ignoreboth When the user opens a terminal, an error message appears: Octal number out of range Which of the following lines in the partial .bashrc should be modified to prevent the error from occurring?

Options

  • AHISTSIZE=800
  • BHISTFILESIZE=1000
  • Cumask 2002
  • DHISTCONTROL=ignoreboth

Explanation

The error "Octal number out of range" occurs because the umask command expects a valid octal number between 0 and 777. The value 2002 is outside this valid range for setting file permissions.

Common mistakes.

  • A. HISTSIZE=800 sets the number of commands to remember in the history list; 800 is a valid decimal integer for this variable and does not cause an octal error.
  • B. HISTFILESIZE=1000 sets the maximum number of lines contained in the history file; 1000 is a valid decimal integer for this variable and does not cause an octal error.
  • D. HISTCONTROL=ignoreboth sets a variable that controls how commands are saved in the history list; it takes a string value and does not involve octal numbers.

Concept tested. Linux umask command and octal permissions

Reference. https://man7.org/linux/man-pages/man1/umask.1.html

Topics

#umask#Bash configuration#File permissions#Shell environment

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions