【问题标题】:using sed command need to change one line in nginx conf使用 sed 命令需要在 nginx conf 中更改一行
【发布时间】:2021-06-02 13:42:35
【问题描述】:

nginx.conf中需要改一行

client_max_body_size 1m to client_max_body_size 10m 我用这个命令

sed -i "s/^client_max_body_size 1m;$/client_max_body_size 10m;/g" /etc/nginx/nginx.conf
sed: 1: "nginx.conf": extra characters at the end of n command 

收到此消息...我不知道我做错了什么。

【问题讨论】:

    标签: sed


    【解决方案1】:

    你可以使用

    sed -i '' 's/^client_max_body_size 1m;$/client_max_body_size 10m;/g' /etc/nginx/nginx.conf
    

    FreeBSD sed-i 选项之后的'' 启用就地匹配。

    【讨论】:

      猜你喜欢
      • 2013-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-22
      • 2023-03-28
      • 2014-08-03
      • 2022-10-23
      相关资源
      最近更新 更多