Does intermediate images occupy memory in docker?

If there are RUN commands in docker file then it does create some intermediate images. My question is whether such intermediate images occupy any memory of your hard drive? If yes, docker build –rm should be enough?

Source: StackOverflow