---
title: "批量替换指令"
author: "pcpig"
date: "2015-09-10T14:42:29Z"
tags: []
categories: ["研发管理"]
slug: "untitled"
draft: false
lastmod: "2015-09-10T14:42:29Z"
id: 2242397
url: "https://pcpig.iteye.com/blog/2242397"
---

2155  find ./ -name "*.jsp" | xargs -i perl -p -i.bak -e 's/\r\n/\n/g' {}

find ./ -name "*.bak" -type f -print -exec rm {} \;

如果不想备份

perl -pie 's/\r\n/\n/g' file