python script execute clear command ubuntu code example Example 1: console clear python import os os.system('clear') Example 2: cmd clear dns cache ipconfig /flushdns