On a Debian-based system, apply a common prompt setting to every user's interactive Bash.
Which location is appropriate?
On Debian-based systems, /etc/bash.bashrc is used for system-wide interactive Bash settings. Startup-file conventions vary by distribution.
Detailed explanation
/etc/bash.bashrcCorrect. Debian systems use /etc/bash.bashrc for common interactive Bash configuration.
Correct. Debian systems use /etc/bash.bashrc for common interactive Bash configuration.
/etc/profileIncorrect. /etc/profile primarily initializes login shells.
Incorrect. /etc/profile primarily initializes login shells.
~/.bashrcIncorrect. ~/.bashrc affects only one user.
Incorrect. ~/.bashrc affects only one user.
/etc/skel/.bashrcIncorrect. /etc/skel/.bashrc is a template copied for new users.
Incorrect. /etc/skel/.bashrc is a template copied for new users.
Try it yourself
An example you can run in a temporary verification environment.
if test -r /etc/bash.bashrc; then sed -n '1,8p' /etc/bash.bashrc; else echo not-present; fiExpected result
Debian系ではファイル先頭、その他ではnot-presentの場合があるKey points
- Debian-wide bashrc
- Interactive settings
- Distribution differences matter
Notes
- Environment: Debian系 GNU Bash / 読み取りのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.