I
I
Ilya Beloborodov2015-12-29 17:43:53
linux
Ilya Beloborodov, 2015-12-29 17:43:53

How to replace lines in a file via terminal?

There is a text file weighing 750mb. Is it possible to replace the word utf8mb4_unicode_ci with utf8_general_ci in this file through the terminal ?
Tried with a text editor. Everything lags

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alexxandr, 2015-12-29
@alexxandr

sed -i 's/utf8mb4_unicode_ci/utf8_general_ci/g' /path/to/file

F
falsebyte, 2015-12-29
@falsebyte

perl -i -pe 's/utf8mb4_unicode_ci/utf8_general_ci/;' insider_2015-12-29.sql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question