命令行:
perl -pi -e 's|[old_string]|[new_string]|g' [file]

find和xargs组合,递归的改变目录下所有文件的内容
find /etc -type f| xargs perl -pi -e 's|/var/spool/mail|/var/spool/messages|g'

相关文章: