You can use docker command “docker attach” to attach your terminal’s standard input, output, and error to a running container by using either container’s ID or name.
This docker command helps you to see its currently running output or to control it interactively.
Here is an example of using docker attach to a running container:
$ docker run -d --name topdemo ubuntu /usr/bin/top -b
$ docker attach topdemo
I recommend this Docker Training Course by Intellipaat to learn Docker.
Also, you can watch this Docker commands tutorial: