I would like to know to how to do in Ruby what I can do with system("clear")
in C. I wrote a program like
puts "amit" system("clear")
I want the console to be cleared after executing this commnad, but it is not working.
A common way to do that is to use the `clear` command, or its keyboard shortcut CTRL+L.
To clear Julia REPL, press Ctrl + L .
Clearing the Console To get a clean slate in your console, use Command + K on the Mac. You can also use Ctrl + L to clear the screen, which works on both Mac and Linux.
If you are using the default unity terminal, you can go to Terminal > Reset and clear. then you can view it using a text editor. That would let you scroll the file manually.
If you want something that is vaguely portable you can try:
system "clear" || system "cls"
which will try both clear
and cls
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With