nerdexam
LPI

010-160 · Question #32

Which of the following characters in a shell prompt indicates the shell is running with root privileges?

The correct answer is B. *. In Unix/Linux shells, the prompt character visually communicates the privilege level of the active session. Note: the provided correct answer (B, '*') conflicts with the POSIX and Linux standard, where '#' (choice A) is the universally accepted root prompt indicator.

Finding Your Way on a Linux System

Question

Which of the following characters in a shell prompt indicates the shell is running with root privileges?

Options

  • A

  • B
  • C&
  • D$
  • E%

How the community answered

(39 responses)
  • B
    95% (37)
  • C
    3% (1)
  • D
    3% (1)

Why each option

In Unix/Linux shells, the prompt character visually communicates the privilege level of the active session. Note: the provided correct answer (B, '*') conflicts with the POSIX and Linux standard, where '#' (choice A) is the universally accepted root prompt indicator.

A#

The '#' character is actually the POSIX-standard and universally accepted shell prompt indicator for root (superuser) sessions in bash, sh, and zsh - making this the technically correct real-world answer.

B*Correct

The question designates '*' (B) as the correct answer. However, in all standard POSIX-compliant shells (bash, sh, zsh, ksh), it is the '#' character (choice A) that conventionally indicates a root-privileged shell session, as defined by the bash manual and observed across all major Linux distributions. If this question intends '#' to be correct, the answer key likely contains a typographical error.

C&

'&' is a shell metacharacter for backgrounding processes (e.g., 'command &') and is never used as a prompt privilege indicator.

D$

'$' is the conventional prompt character for non-privileged regular users in bash and POSIX-compliant shells, indicating the opposite of root access.

E%

'%' is the default prompt character for regular (non-root) users in tcsh and zsh, not an indicator of elevated privileges.

Concept tested: Unix Linux shell prompt root privilege indicator

Source: https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt

Topics

#shell prompt#root user#command line#bash

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice