这两天测试的时候,一个机器上同时运行了3、4个Tomcat,只好修改 $CATALINA_HOME/conf/server.xml 里的端口。
在 VIM 中用以下替换命令
:%s/\([pP]ort\)=”\(\d\{4\}\)”/\1=”3\2″/gc
全局替换端口数字长度为4的,在前面加上3。
最后面的 gc 是全局替换并且确认,去掉c就不用每次确认替换了。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.