ini/config 文件在 linux/unix 中的位置? [英] Location of ini/config files in linux/unix?
问题描述
两个问题,真的:
是否有关于配置文件放置的标准/约定?
Is there a standard/convention regarding the placement on configuration files?
对于系统或准系统程序,它们似乎通常位于 /etc
中的某个位置.对于普通应用程序或 /etc
权限不足的程序似乎不太清楚.
For system or quasi-system programs they seem to usually be somewhere in /etc
. It seems less clear for plain application programs or programs with insufficient privileges for /etc
.
在处理程序选项时,是否有优先的标准层次结构?例如.命令行选项是否会覆盖初始化文件和/或环境变量?反之亦然?或者这完全取决于开发者?
In processing program options is there a standard hierarchy of what takes precedence? E.g. does a command line option override an initialization file and/or an environment variable? Vice versa? Or is this entirely up to the developer?
推荐答案
- 通常系统/全局配置存储在/etc 下的某处.
- 用户特定的配置存储在用户的主目录中,通常作为隐藏文件,有时作为包含非隐藏文件(可能还有更多子目录)的隐藏目录.
一般来说,命令行选项将覆盖环境变量,这些环境变量将覆盖用户默认值,而用户默认值将覆盖系统默认值.
Generally speaking, command line options will override environment variables which will override user defaults which will override system defaults.
这篇关于ini/config 文件在 linux/unix 中的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!