【发布时间】:2022-08-21 00:30:28
【问题描述】:
我有以下文件:
/Users/x/-acite _1660475490N.html
/Users/x/-acite _1660464772N.html
/Users/x/-acite _1660464242N.html
/Users/x/-acite _1660463321N.html
/Users/x/-acite _1660421444N.html
/Users/x/-acite _1612414441N.html
/Users/x/fix _1660399672N.html
/Users/x/fix _1660398829N.html
/Users/x/water witching _1660460617N.html
/Users/x/water witching _1660388149N.html
/Users/x/water witching _1632222441N.html
/Users/x/water witching _1660003224N.html
我需要
/Users/x/-acite _1660475490N.html
/Users/x/fix _1660399672N.html
/Users/x/water witching _1660460617N.html
我使用以下 perl 正则表达式:
find . -type f -exec perl -pi -w -e \'s/(.*)(\\R)(.*)(\\R)/$1$2/\' \\{\\} \\;
或者
find . -type f -exec perl -pi -w -e \'s/(.*?)(\\R)(.*?)(\\R)/$1$2/g;\' \\{\\} \\;
为什么这些不起作用?