Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear screen in shell

Just a quick question:
How do you clear the screen in shell? I've seen ways like:

import os os.system('cls') 

This just opens the windows cmd, clears the screen and closes but I want the shell window to be cleared
(PS: I don't know this helps, but I'm using version 3.3.2 of Python)
Thank you :)

like image 851
josh Avatar asked Sep 21 '13 20:09

josh


People also ask

What is clear in shell script?

clear is a standard Unix computer operating system command that is used to clear the terminal screen. This command first looks for a terminal type in the environment and after that, it figures out the terminfo database for how to clear the screen.

How do I clear the spark shell screen?

To clear your screen do one of the following: Issue clear or cls in your shell. Press Ctrl+L or other hotkey, if your shell supports it.

What is clear screen in Linux?

You can use Ctrl+L keyboard shortcut in Linux to clear the screen. It works in most terminal emulators.


1 Answers

What about the shortcut CTRL+L?

It works for all shells e.g. Python, Bash, MySQL, MATLAB, etc.

like image 141
Hafiz Muhammad Shafiq Avatar answered Sep 29 '22 10:09

Hafiz Muhammad Shafiq