mridul4c mridul4c - 1 year ago 141
Linux Question

How to replace a string in multiple files in linux command line

I need to replace a text in so many files in a folder, I only have

access of the server. How can I do that ? Please help.

kev kev
Answer Source
cd /path/to/your/folder
sed -i 's/foo/bar/g' *

Occurrences of "foo" will be replaced with "bar".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download