<filename>clean-line.py
import os
import sys
import time
import datetime

def scanner():
    os.system("sudo du -sh /var/cache/apt")
    os.system("journalctl --disk-usage")
    os.system("du -sh ~/.cache/thumbnails")

def cleaner():
    print("Cleaning APT cache...")
    os.system("sudo apt-get clean")
    print("Cleaning journalctl logs...")
    os.system("sudo journalctl --vacuum-time=3d")
    print("Cleaning thumbnails...")
    os.system("sudo rm -rf ~/.cache/thumbnails/*")
    print("Cleaning recycle bin...")
    os.system("rm -rf /home/*/.local/share/Trash/*/** &> /dev/null")
    time.sleep(0.5)
    os.system("rm -rf /root/.local/share/Trash/*/** &> /dev/null")

print("Welcome to CleanLine!")
print("CleanLine v1.0")
print("https://github.com/Liniuta/CleanLine/")
print("Free up space on your Linux machine")
print("This tool cleans:")
print("APT cache, Journalctl logs, Files and folders from recycle bin ,Thumbnails cache")
print("Tool started on" + " " + str(datetime.datetime.now()))
print("User is"+ " " + os.getlogin())
time.sleep(3)
print("Checking for root access..")
if not os.geteuid() == 0:
    print("You must be a root user to use this tool!")
    print('"sudo python clean-line.py"')
    os._exit(1)
else:
    print("OK!")
    time.sleep(2)
    print("Scaning for files that can be deleted..")
    scanner()
    time.sleep(3)
    print("Cleaning starting in 10 seconds!")
    print("PRESS CTRL+C TO ABORT")
    t_end = time.time() + 10 * 1
    while time.time() < t_end:
        time.sleep(1)
        print("1")
        time.sleep(1)
        print("2")
        time.sleep(1)
        print("3")
        time.sleep(1)
        print("4")
        time.sleep(1)
        print("5")
        time.sleep(1)
        print("6")
        time.sleep(1)
        print("7")
        time.sleep(1)
        print("8")
        time.sleep(1)
        print("9")
        time.sleep(1)
        print("10")
        cleaner()
        time.sleep(1)
        print("CleanLine finished on" + " " + str(datetime.datetime.now()))
        print("Exiting..")
        os._exit(1)
<filename>clean-line.py
import os
import sys
import time
import datetime

def scanner():
    os.system("sudo du -sh /var/cache/apt")
    os.system("journalctl --disk-usage")
    os.system("du -sh ~/.cache/thumbnails")

def cleaner():
    print("Cleaning APT cache...")
    os.system("sudo apt-get clean")
    print("Cleaning journalctl logs...")
    os.system("sudo journalctl --vacuum-time=3d")
    print("Cleaning thumbnails...")
    os.system("sudo rm -rf ~/.cache/thumbnails/*")
    print("Cleaning recycle bin...")
    os.system("rm -rf /home/*/.local/share/Trash/*/** &> /dev/null")
    time.sleep(0.5)
    os.system("rm -rf /root/.local/share/Trash/*/** &> /dev/null")

print("Welcome to CleanLine!")
print("CleanLine v1.0")
print("https://github.com/Liniuta/CleanLine/")
print("Free up space on your Linux machine")
print("This tool cleans:")
print("APT cache, Journalctl logs, Files and folders from recycle bin ,Thumbnails cache")
print("Tool started on" + " " + str(datetime.datetime.now()))
print("User is"+ " " + os.getlogin())
time.sleep(3)
print("Checking for root access..")
if not os.geteuid() == 0:
    print("You must be a root user to use this tool!")
    print('"sudo python clean-line.py"')
    os._exit(1)
else:
    print("OK!")
    time.sleep(2)
    print("Scaning for files that can be deleted..")
    scanner()
    time.sleep(3)
    print("Cleaning starting in 10 seconds!")
    print("PRESS CTRL+C TO ABORT")
    t_end = time.time() + 10 * 1
    while time.time() < t_end:
        time.sleep(1)
        print("1")
        time.sleep(1)
        print("2")
        time.sleep(1)
        print("3")
        time.sleep(1)
        print("4")
        time.sleep(1)
        print("5")
        time.sleep(1)
        print("6")
        time.sleep(1)
        print("7")
        time.sleep(1)
        print("8")
        time.sleep(1)
        print("9")
        time.sleep(1)
        print("10")
        cleaner()
        time.sleep(1)
        print("CleanLine finished on" + " " + str(datetime.datetime.now()))
        print("Exiting..")
        os._exit(1)