当前位置:网站首页>通过sed 修改conf文件
通过sed 修改conf文件
2022-07-28 05:47:00 【独家雨天】
比如,我们需要修改 postgresql 中的 postgresql.conf 文件中的 password_encryption 属性为 md5。
$ grep password postgresql.conf
#password_encryption = scram-sha-256 # scram-sha-256 or md5
可以如下的sed 命令来修改
sed -i -E 's/^#?(password_encryption = )\S+(\s+#.*)/\1md5\2/' /tmp/postgresql.conf
其中 -E 表示启用正则表达式
#?表示该配置有可能被 注释diaol(password_encryption = )表示需要匹配的key值\S+表示替换的非空的value值(\s+#.*)表示保留的后续的注释内容
边栏推荐
猜你喜欢

Easypoi one to many, merge cells, and adapt the row height according to the content

和为s的两个数字——每日两题

JS upload file method

Big talk persistence and redolog

cdn.jsdelivr.net不可用,该怎么办

Current limiting ratelimiter of guava

删除链表中的节点——每日一题

Gd32f407 porting freertos+lwip

Soft exam certificate can be used like this! Get a certificate = get a professional title?

ThreadLocal那些事
随机推荐
5G 商用第三年:无人驾驶的“上山”与“下海”
C language review (modifier article)
Install Nessus under win
Install Nessus under Kali
Current limiting ratelimiter of guava
Deeply analyze the implementation of singleton mode
TOPK problem
Tailing microelectronics B91 general development board integrated into the trunk of openharmony community
Open virtual machine kali2022.2 and install GVM
Continous Gesture Recognition with hand-orented spatiotemporal feature
High response ratio first
【着色器实现Negative反色效果_Shader效果第十一篇】
VCF file production
面试中必不可少的性能优化专题~
WiFi one click connection configuration of raspberry pie
Install pycharm
牛客Mysql——SQL必知必会
Log in to Oracle10g OEM and want to manage the monitor program, but the account password input page always pops up
MySQL基础知识学习(二)
PyTorch - Dropout: A Simple Way to Prevent Neural Networks from Overfitting