Activities

July 2010
M T W T F S S
« Jun   Aug »
 1234
567891011
12131415161718
19202122232425
262728293031  

How do I delete a word containing lines

During the mail server setup, I am facing to edit/add the line in between the specified tag containing lines in dovcot (pop3 server). It’s just because of that default configuration files having more than 1000 line and 97% of lines are instructions.

So I would like to remove all the lines begin with the word “#” to get a clean, configuration lines.

# sed -e '/#/d' < /etc/dovecot.conf > /tmp/dovecot.conf
#mv /etc/dovecot.conf /etc/dovecot.conf-bk
# cp /tmp/dovecot.conf /etc/dovecot.conf
-sh-3.2# service dovecot restart
Stopping Dovecot Imap:                                     [  OK  ]
Starting Dovecot Imap:                                     [  OK  ]


Note : Ensure that you have a backup copy before doing this 🙂

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>