Written on 2020-03-02 05:29:00

Last updated 2020-11-06 14:46:00

How to replace content in large file?


Many time developer just need to replace a bit of text inside the large file like *.sql or *.sqlite
Opening a file into editor take too much resource of system or server. So I come up with the very easy and useful way to replace content into large file using linux command like. sed command.

Here I am taking an example of MySql file which having *.sql as file extension

sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g'

or

sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g'
blog comments powered by Disqus