nerdexam
CompTIA

LX0-104 · Question #461

A user complained that programs started from his shell won't use his favorite editor. Which of the following files should you edit to change this?

The correct answer is B. .bashrc. To set a user's preferred editor for programs launched from their shell, environment variables like EDITOR or VISUAL are typically configured in their shell's startup files.

Shells, Scripting and Data Management

Question

A user complained that programs started from his shell won't use his favorite editor. Which of the following files should you edit to change this?

Options

  • A.editor
  • B.bashrc
  • C.bash_rc
  • D~/bash.conf

How the community answered

(20 responses)
  • B
    90% (18)
  • C
    5% (1)
  • D
    5% (1)

Why each option

To set a user's preferred editor for programs launched from their shell, environment variables like `EDITOR` or `VISUAL` are typically configured in their shell's startup files.

A.editor

There is no standard `.editor` file for configuring a user's default editor; this is managed via environment variables.

B.bashrcCorrect

The `.bashrc` file is a user-specific configuration file executed every time a new interactive non-login bash shell is started. It is the appropriate place to set environment variables like `EDITOR` or `VISUAL` to define the preferred text editor for that user.

C.bash_rc

`.bash_rc` is a common typo; the correct filename is `.bashrc`.

D~/bash.conf

`~/bash.conf` is not a standard or automatically sourced configuration file for bash shells.

Concept tested: User shell environment configuration

Source: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-Startup-Files

Topics

#bash#shell configuration#environment variables#dotfiles

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice