当前位置:网站首页>通过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+#.*)表示保留的后续的注释内容
边栏推荐
- xmpp 服务研究(二) prosody 创建账户
- vcf文件制作
- Rsync+inotify to realize remote real-time synchronization
- Deeply analyze the implementation of singleton mode
- 教程篇(7.0) 06. 零信任网络访问ZTNA * FortiClient EMS * Fortinet 网络安全专家 NSE 5
- A timed task reminder tool
- Current limiting ratelimiter of guava
- TOPK problem
- Reasons why null is not recommended for MySQL fields
- Shell --- conditional statement practice
猜你喜欢

最早截止时间优先(EDF)

Deeply analyze the implementation of singleton mode

How low-end computers learn secrets in depth - using the mistgpu computing platform

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

Shell--- function

guava之限流RateLimiter

Reasons why null is not recommended for MySQL fields

Add, delete, check and modify linked lists

JS secondary linkage Department

Freemaker exports word with tables and multiple pictures to solve the repetition and deformation of pictures
随机推荐
How to understand CMS collector to reduce GC pause time
最早截止时间优先(EDF)
Redis主从复制原理及配置
rsync+inotify实现远程实时同步
Redis的RDB持久化和AOF持久化的底层原理
两个链表的第一个公共节点——每日两题
Install pycharm
object detection
Big talk persistence and redolog
【着色器实现Negative反色效果_Shader效果第十一篇】
链表中倒数第k个节点——双指
Blueberry pie Bluetooth debugging process
Circular linked list problem
User mode vs kernel mode, process vs thread
Basic knowledge of video format: let you know MKV, MP4, h.265, bit rate, color depth, etc
High response ratio first
heroku 操作总结
0727~面试题梳理
guava之guava cache
再次出现用户净流失,大失颜面的中国移动推出超低价套餐争取用户