[英]search and replace tools in linux
What are the best search and replace tools in linux? Linux中最好的搜索和替换工具是什么?
I want to find an easy way. 我想找到一种简单的方法。
Thanks 谢谢
It will replace strings with new strings in multiple text files. 它将用多个文本文件中的新字符串替换字符串。 It can work recursively over directories and supports limiting the search to specific file suffixes.
它可以在目录上递归工作,并支持将搜索限制为特定的文件后缀。
rpl [-iwRspfdtx [-q|-v]] <old_str> <new_str> <target_file(s)>
find
for finding files/directories find
以查找文件/目录
grep
or ack
[1] for searching files grep
或ack
[1]用于搜索文件
sed
for search/replace in files sed
用于搜索/替换文件
awk
and cut
for slicing/dicing text awk
和cut
用于切片/切块文本
for anything non-trivial I usually reach for perl
对于任何平凡的东西,我通常都会
perl
[1] http://betterthangrep.com/ [1] http://betterthangrep.com/
find
和sed
是经典工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.