> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/t/terminal-control/clear_the_screen.md).

# Clear the screen

Using a cached-function:

```ruby
func clear { print(static x = `clear`) }
clear()
```

Directly invoking the \`clear\` command:

```ruby
Sys.run('clear')
```

Alternatively, without reliance on the command line:

```ruby
print "\e[3J\e[H\e[2J"
```
