nerdexam
CompTIA

XK0-005 · Question #258

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…

The correct answer is C. umask 2002. The error "Octal number out of range" occurs because the umask 2002 line specifies an invalid octal value for the umask, as umask values should conform to a standard octal permission format (e.g., 002, 022, or 0022).

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

How the community answered

(48 responses)
  • A
    4% (2)
  • B
    8% (4)
  • C
    71% (34)
  • D
    17% (8)

Why each option

The error "Octal number out of range" occurs because the `umask 2002` line specifies an invalid octal value for the umask, as umask values should conform to a standard octal permission format (e.g., `002`, `022`, or `0022`).

AHISTSIZE=800

`HISTSIZE` specifies the number of commands to store in the history list and uses a decimal integer, so `800` is a valid value.

BHISTFILESIZE=1000

`HISTFILESIZE` specifies the maximum number of lines contained in the history file and uses a decimal integer, so `1000` is a valid value.

Cumask 2002Correct

The `umask` command expects an octal value that specifies permissions to be masked from newly created files and directories, and `2002` is not a valid octal umask value, typically causing an "Octal number out of range" error.

DHISTCONTROL=ignoreboth

`HISTCONTROL` defines how commands are saved in the history list and `ignoreboth` is a valid keyword for this variable.

Concept tested: umask configuration and octal permissions

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

Topics

#umask#bashrc#file permissions#error troubleshooting

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice