您的位置:首页 > 其它

特定目录字符查找替换 sed -i 's/old/new/g' $(grep -lR old /path)

2012-08-29 15:52 344 查看
Sed命令实现目录下多文件的字符替换

指令: 

              sed -i 's/old/new/g' $(grep -lR old *)

注意:

              -R, -r, --recursive       equivalent to --directories=recurse

                         --include=PATTERN     files that match PATTERN will be examined

                         --exclude=PATTERN     files that match PATTERN will be skipped.

                         --exclude-from=FILE   files that match PATTERN in FILE will be skipped.

              -L, --files-without-match only print FILE names containing no match

              -l, --files-with-matches  only print FILE names containing matches

              -c, --count               only print a count of matching lines per FILE

              -Z, --null                print 0 byte after FILE name
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: