nerdexam
CompTIA

XK0-005 · Question #588

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the ls command. The output displays files that reside in Ann's…

The correct answer is A. su - Joe. The su command is used to switch to another user account on Linux systems. The - option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of…

System Management

Question

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the ls command. The output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

Options

  • Asu - Joe
  • Bsudo Joe
  • Cvisudo Joe
  • Dpkexec Joe

How the community answered

(49 responses)
  • A
    86% (42)
  • B
    2% (1)
  • C
    4% (2)
  • D
    8% (4)

Explanation

The su command is used to switch to another user account on Linux systems. The - option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of the original user. This can cause confusion when issuing commands that depend on these variables, such as ls, which uses the $HOME variable to determine the home directory. Therefore, Ann should have issued su - Joe to list Joe's files instead of her own.

Topics

#User management#Linux commands#Shell environment#Directory navigation

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice