How do I edit a file after I shell to a Docker container?

后端 未结 16 1950
你的背包
你的背包 2020-11-29 14:22

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

16条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 15:07

    You can use cat if installed, with the > caracter. Here is the manipulation :

    cat > file_to_edit
    #1 Write or Paste you text
    #2 don't forget to leave a blank line at the end of file
    #3 Ctrl + C to apply configuration
    

    Now you can see the result with the command

    cat file
    

提交回复
热议问题