| |
Linux下如何找到配置文件的写法

新手常会困惑于配置文件里面的参数写法。而对于配置文件,我们可以通过以下方式来找到配置文件的写法。

1:通过man命令"man 5 file.conf"

2: 通过配置文件本身
[root@kook samba]# pwd
/etc/samba
[root@kook samba]# ls
lmhosts  smb.conf
[root@kook samba]# head smb.conf
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba,
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the
上面的命令已经有答案了。用man 5,看看下面的这个。
[root@kook conf]# pwd
/etc/logwatch/conf
[root@kook conf]# ls
ignore.conf  logfiles  logwatch.conf  override.conf  services
[root@kook conf]# head logwatch.conf
# Local configuration options go here (defaults are in /usr/share/logwatch/default.conf/logwatch.conf)
或者在/user/share这个文档目录里面。

3:总结一下,配置文件如果有相关的解释说明的话,要么出现在man 5里面,要么就存在于rpm包的对应的文档里面。所以可以通过反向来分析得到。
如果知道这个配置文件属于那个rpm包,在看一下rpm包的所有文件。就可以得到结论了。
[root@kook conf]# rpm -qf /etc/file.conf
someone.rpm
[root@kook conf]# rpm -ql someone | less


本文链接:http://www.52zhe.cn/read.php/151.htm
本文作者:kook(若就博客内所涉及的技术问题交流,请用下面的MSN或Gmail联系我)
联系方式:(MSN:kook#live.com) (Google talk:kookliu)
没有版权:GNU,转载时请注明“转载人”欠本人一顿饭,来日见面之时兑现!谢谢合作!
by kook | 分类: Linux | 评论(0) | 引用(0) | 阅读(1056)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]