Link to home
Start Free TrialLog in
Avatar of LeviDaily
LeviDailyFlag for United States of America

asked on

Debian SED command, Multiple line search and replace

I have a config file that I am trying to edit with sed. Currently I am searching one line and replacing and it is working, but I would like to search and replace multiple lines and I am not sure on the correct command.

sudo sed -e "s/anonymous_enable=YES/anonymous_enable=NO/g" /etc/vsftpdbackup.conf
*This above works great, but I have another line below that I need to replace.

The config file looks like this:
anonymous_enable=YES
local_enable=NO      **needs to be yes
write_enable=YES     **need to comment this out with #
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeviDaily

ASKER

Thanks, that works!!