I successfully shelled to a Docker container using:
docker exec -i -t 69f1711a205e bash
Now I need to edit file and I don\'t have any edito
See Stack Overflow question sed edit file in place
It would be a good option here, if:
cat
.Install Vim is not allowed or takes too long.
My situation is using the MySQL 5.7 image when I want to change the my.cnf
file, there is no vim
, vi
, and Vim install takes too long (China Great Firewall). sed
is provided in the image, and it's quite simple. My usage is like
sed -i /s/testtobechanged/textwanted/g filename
Use man sed
or look for other tutorials for more complex usage.