# How to change the entire command line

**URL:** <https://discourse.julialang.org/t/how-to-change-the-entire-command-line/72824>\
**Category:** General Usage\
**Created:** [December 9, 2021, 1:19pm UTC](https://discourse.julialang.org/t/how-to-change-the-entire-command-line/72824 "2021-12-09T13:19:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renan\_Rabelo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/renan_rabelo/32/8048_2.png) [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Post date:** [December 9, 2021, 1:19pm UTC](https://discourse.julialang.org/t/how-to-change-the-entire-command-line/72824/1 "2021-12-09T13:19:13Z")

</div>

Hello everyone,

This might be a weird question, and I don’t know how to ask it properly, but I really would like to know how to change the text of a command line without using print().

A good example is in [this video](https://www.youtube.com/watch?v=IEbFwDv1RHU), where the entire command line changes instead of printing every line.

Thaks!

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [December 9, 2021, 1:41pm UTC](https://discourse.julialang.org/t/how-to-change-the-entire-command-line/72824/2 "2021-12-09T13:41:16Z")

</div>

I assume you are talking about output. In that case you print `\r` to move the cursor to start of the line, then print over:

```julia
julia> println("hello world\rworld")
world world

```

You can also print `\e[K` to clear the rest of the line:

```julia
julia> println("hello world\rhi\e[K")
hi

```

See e.g. [https://en.wikipedia.org/wiki/ANSI\_escape\_code](https://en.wikipedia.org/wiki/ANSI_escape_code).

---

<div class="post-metadata">

**Author:** ![Renan\_Rabelo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/renan_rabelo/32/8048_2.png) [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Post date:** [December 9, 2021, 1:45pm UTC](https://discourse.julialang.org/t/how-to-change-the-entire-command-line/72824/3 "2021-12-09T13:45:46Z")

</div>

Thanks, that is really useful!

It is possible to clear the entire command line instead of just scrolling down?
