When a :buffer is specified, output goes to that buffer, which is erased first, e.g.: #+begin_src sh :results buffer echo foo #+end_src