zjm1126
zjm1126

Reputation: 35680

search and replace tools in linux

What are the best search and replace tools in linux?

I want to find an easy way.

Thanks

Upvotes: 4

Views: 2150

Answers (3)

gsiems
gsiems

Reputation: 3790

find for finding files/directories

grep or ack[1] for searching files

sed for search/replace in files

awk and cut for slicing/dicing text

for anything non-trivial I usually reach for perl

[1] http://betterthangrep.com/

Upvotes: 3

keheliya
keheliya

Reputation: 2553

You can use rpl.

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)> 

Upvotes: 5

Conrad Meyer
Conrad Meyer

Reputation: 2897

find and sed are the classic tools.

Upvotes: 1

Related Questions