LFCS · 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, the user's ~/.bashrc file is the correct configuration location.
Question
Options
- A.editor
- B.bashrc
- C.bash_rc
- D~/bash.conf
How the community answered
(44 responses)- A7% (3)
- B86% (38)
- C2% (1)
- D5% (2)
Why each option
To set a user's preferred editor for programs launched from their shell, the user's `~/.bashrc` file is the correct configuration location.
`.editor` is not a standard shell configuration file used for setting a preferred editor.
The `~/.bashrc` file is executed by Bash for interactive non-login shells, making it the appropriate place to set environment variables like `EDITOR` or `VISUAL` for user-specific preferences.
`.bash_rc` is a common misspelling; the correct file name for user Bash configuration is `.bashrc`.
`~/bash.conf` is not a standard configuration file that Bash automatically sources.
Concept tested: User-specific Bash shell configuration
Source: https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files
Topics
Community Discussion
No community discussion yet for this question.