# Command to clean the screen in IRB? (like when pressing "Ctrl+L")

**URL:** <https://www.ruby-forum.com/t/command-to-clean-the-screen-in-irb-like-when-pressing-ctrl-l/147445>\
**Category:** Ruby\
**Created:** [September 1, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/command-to-clean-the-screen-in-irb-like-when-pressing-ctrl-l/147445 "2008-09-01T22:34:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [September 1, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/command-to-clean-the-screen-in-irb-like-when-pressing-ctrl-l/147445/1 "2008-09-01T22:34:34Z")

</div>

Hi, I expect there is a command to clean the screen during an IRB  
session (in  
fact you can press Ctrl+L to do it, but I’m lookinf for a Ruby command).  
What  
is that command?

thanks a lot.

---

<div class="post-metadata">

**Author:** ![ISSSSaki\_Baz\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/51bf81/32.png) [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Post date:** [September 1, 2008, 10:39pm UTC](https://www.ruby-forum.com/t/command-to-clean-the-screen-in-irb-like-when-pressing-ctrl-l/147445/2 "2008-09-01T22:39:15Z")

</div>

El Lunes, 1 de Septiembre de 2008, IÃ±aki Baz C. escribiÃ³:

> Hi, I expect there is a command to clean the screen during an IRB session  
> (in fact you can press Ctrl+L to do it, but I’m lookinf for a Ruby  
> command). What is that command?

Well, after looking I’ve found that there is not such command, but some  
workarounds:

print “\e[2J\e[f”

or:

system(“clear”)
