clear terminal windows code example

Example 1: clear terminal windows

cls
===============================
will clear the windows terminal

Example 2: clear cmd

just type cls and hit enter

Example 3: windows clear terminal

Type in "cls" and press enter

Example 4: clear terminal

clear               # only clear visible screen
clear && clear      # clear buffer as well
tput clear          # same as clear but by sending escape seq
reset               # clear + reset internal terminal state + 1sec delay
tput reset          # same as reset but without 1sec delay
stty sane           # don't clear screen but reset some terminal options
echo -e "\033c"     # same as tput reset but hardcoded escape seq
printf "\033c"      # same as tput reset but hardcoded escape seq
setterm -reset      # same as tput reset, setterm has friendlier commands

Example 5: clear in windows cmd

cls  #this command clears the command window in Windows Command Prompt

Example 6: clear terminal windows

cls
//clean terminal only on windows