using sed command need to change one line in nginx conf

Viewed 329

Need to change one line in nginx.conf

client_max_body_size 1m to client_max_body_size 10m I used this command

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 

got this message... I don't know what I did wrong.

1 Answers

You can use

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

The '' after -i option in FreeBSD sed enable inplace matching.

Related