当前位置:网站首页>Crudini 配置文件编辑工具
Crudini 配置文件编辑工具
2022-07-07 01:25:00 【华为云】
Crudini 是 Pádraig Brady 用 Python 开发的、用来对ini配置文件进行编辑的工具。
crud是4个单词的首字母简写,即create、read、update和delete,中文译为“增删改查”。这个是数据的最常见的4类操作方法。
安装
# centosyum install -y crudini语法格式
crudini --set [OPTION]... config_file section [param] [value] crudini --get [OPTION]... config_file [section] [param] crudini --del [OPTION]... config_file section [param] [list value] crudini --merge [OPTION]... config_file [section]常用参数:
| --get | 获取配置文件中的节或键值 |
| --set | 设置键值 |
| --merge | 合并配置文件 |
| --format=FMT | 为--get 使用,选择输出格式。格式有sh,ini,lines |
| --inplace | 锁定并写入文件, 比默认的替换有更少的限制 |
| --list | 为--set和--del,更新一个列表(集合)的值 |
| --list-sep=STR | 使用自定义的字符代替默认的逗号 |
| --output=FILE | 将输出写入文件。’-“表示标准输出” |
| --verbose | 在错误输出上指出是否进行了更改 |
示例
获取一个键值
# 获取 nova.conf配置文件 TEST节 abc键的值crudini --get nova.conf TEST abc获取一个不在节里面的值
crudini --get nova.conf '' abc获取一个节的键
crudini --get nova.conf DEFAULT添加或更新一个不在节里面的值
crudini --get nova.conf '' abc 456添加或更新一个键值
# 设置 cinder.conf文件 DEFAULT节 auth_strategy键的值为keystonecrudini --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone更新一个已存在的键值(如果变量不存在会返回“Parameter not found:”):
crudini --set --existing /etc/cinder/cinder.conf DEFAULT auth_strategy keystone删除一个键
# 删除 nova.conf配置文件 DEFAULT节 abc键crudini --del nova.conf DEFAULT abc删除一个节
# 删除nova.conf配置文件 TEST节crudini --del nova.conf TEST合并配置文件
# 将test1.ini合并到test.inicrudini --merge test.ini < test1.ini# 输出可由shell解析的节 eval $(crudini --get --format=sh config_file section)# 从shell变量更新ini文件 echo name="$name" | crudini --merge config_file section# 使用标准UNIX文本处理比较两个ini文件 diff <(crudini --get --format=lines file1.ini|sort) \ <(crudini --get --format=lines file2.ini|sort)边栏推荐
- 如何在Touch Designer 2022版中设置解决Leap Motion不识别的问题?
- Flask1.1.4 werkzeug1.0.1 source code analysis: start the process
- 云加速,帮助您有效解决攻击问题!
- Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
- Experience of Niuke SQL
- 693. 行程排序
- Flask1.1.4 Werkzeug1.0.1 源码分析:启动流程
- 目标检测中的损失函数与正负样本分配:RetinaNet与Focal loss
- Jstat pour la commande JVM: voir les statistiques JVM
- What EDA companies are there in China?
猜你喜欢

laravel 使用腾讯云 COS5全教程

VScode进行代码补全

The boss always asks me about my progress. Don't you trust me? (what do you think)
![[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core](/img/19/1a6d43c39f2cf810ba754ea9674426.png)
[FPGA tutorial case 13] design and implementation of CIC filter based on vivado core

Peripheral driver library development notes 43: GPIO simulation SPI driver

【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现

Check Point:企业部署零信任网络(ZTNA)的核心要素

Interview skills of software testing

PowerPivot——DAX(函数)
![Cf:c. column swapping [sort + simulate]](/img/0e/64d17980d3ec0051cdfb5fdb34e119.png)
Cf:c. column swapping [sort + simulate]
随机推荐
Peripheral driver library development notes 43: GPIO simulation SPI driver
New Year Fireworks code plus copy, are you sure you don't want to have a look
Go language learning notes - Gorm use - native SQL, named parameters, rows, tosql | web framework gin (IX)
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
关于STC单片机“假死”状态的判别
每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
C. colonne Swapping [tri + Simulation]
Career experience feedback to novice programmers
window下面如何安装swoole
[SQL practice] a SQL statistics of epidemic distribution across the country
Vscode for code completion
高并发大流量秒杀方案思路
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
JVM monitoring and diagnostic tools - command line
3531. 哈夫曼树
Jstack of JVM command: print thread snapshots in JVM
POI excel export, one of my template methods
PowerPivot - DAX (function)
PTA ladder game exercise set l2-002 linked list de duplication
PowerPivot——DAX(函数)