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.
Question
Options
- A.editor
- B.bashrc
- C.bash_rc
- D~/bash.conf
How the community answered
(20 responses)- B90% (18)
- C5% (1)
- D5% (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.
There is no standard `.editor` file for configuring a user's default editor; this is managed via environment variables.
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.
`.bash_rc` is a common typo; the correct filename is `.bashrc`.
`~/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
Community Discussion
No community discussion yet for this question.