ini/config文件在linux/unix中的位置? [英] Location of ini/config files in linux/unix?

查看:177
本文介绍了ini/config文件在linux/unix中的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个问题,真的:

  1. 是否存在关于配置文件放置位置的标准/约定?

  1. 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?

推荐答案

  1. 通常,系统/全局配置存储在/etc下的某个位置.
  2. 特定于用户的配置存储在用户的主目录中,通常作为隐藏文件存储,有时作为包含非隐藏文件(可能还有更多子目录)的隐藏目录存储.

一般而言,命令行选项将覆盖环境变量,而环境变量将覆盖用户默认值,而用户默认值将覆盖系统默认值.

Generally speaking, command line options will override environment variables which will override user defaults which will override system defaults.

这篇关于ini/config文件在linux/unix中的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆