11#! /bin/bash
22
3+ # Iterate over all the files in the folder
4+ for file in usr/bin/functions/* ; do
5+ source " $file "
6+ done
7+
38# Show the menu options
49echo "
510 ____ ____ _ _ _____ ___ ___ _ ____
@@ -9,62 +14,68 @@ echo "
914 |____/|____/|_| \_| |_| \___/ \___/|_____|____/
1015 "
1116echo " ---------------"
12- echo " 1) Analyze disk usage"
13- echo " 2) Delete temporary files"
14- echo " 3) Empty recycle bin"
15- echo " 4) Uninstall program"
16- echo " 5) System information"
17- echo " 6) Memory usage"
18- echo " 7) Exit"
17+ echo -e " \033[31m1) Analyze disk usage\033[0m"
18+ echo -e " \033[32m2) Delete temporary files\033[0m"
19+ echo -e " \033[33m3) Empty recycle bin\033[0m"
20+ echo -e " \033[34m4) Uninstall program\033[0m"
21+ echo -e " \033[35m5) System information\033[0m"
22+ echo -e " \033[36m6) Memory usage\033[0m"
23+ echo -e " \033[31m7) System uptime\033[0m"
24+ echo -e " \033[32m8) Open ports\033[0m"
25+ echo -e " \033[33m9) Search for a file\033[0m"
26+ echo -e " \033[34m10) Exit\033[0m"
1927
2028# Read the user's option
2129read -p " Enter an option: " option
2230
2331# Perform the action corresponding to the chosen option
2432case $option in
25- 1)
26- # Show the used and available space in each of the system's hard drives
27- printf " Disk usage:\n"
28- printf " %-10s %-10s %-10s %-10s %s\n" " Filesystem" " Size" " Used" " Available" " Use%"
29- df -h | tail -n +2 | awk ' { printf "%-10s %-10s %-10s %-10s %s\n", $1, $2, $3, $4, $5 }'
30- ;;
31- 2)
32- # Delete the system's temporary files
33- echo " Deleting temporary files..."
34- sudo rm -rf /tmp/*
35- ;;
36- 3)
37- # Empty the recycle bin
38- echo " Emptying recycle bin..."
39- sudo rm -rf ~ /.local/share/Trash/*
40- ;;
41- 4)
42- # Ask the user to enter the name of the program to uninstall
43- read -p " Enter the name of the program to uninstall: " program
44- # Uninstall the program
45- echo " Uninstalling $program ..."
46- sudo dpkg --purge $program
47- ;;
48- 5)
49- # Show detailed information about CPU and system
50- echo " CPU information:"
51- lscpu
52- echo " "
53- echo " System information:"
54- uname -a
55- ;;
56- 6)
57- # We display the ram usage and the swap usage information
58- echo " Memory usage:"
59- free -h
60- ;;
61- 7)
62- # Exit the application
63- exit
64- ;;
65- * )
66- echo " Invalid option"
67- ;;
33+ 1)
34+
35+ DiskUsage
36+ ;;
37+ 2)
38+
39+ DeleteTemporary
40+ ;;
41+ 3)
42+
43+ DeleteTemporary
44+ ;;
45+ 4)
46+
47+ UninstallPackage
48+ ;;
49+ 5)
50+
51+ SystemInfo
52+ ;;
53+ 6)
54+
55+ MemoryUsage
56+ ;;
57+ 7)
58+
59+ Uptime
60+ ;;
61+ 8)
62+
63+ OpenPorts
64+ ;;
65+ 9)
66+
67+ FindFile
68+ ;;
69+ 10)
70+
71+ # Exit the application
72+ exit
73+ ;;
74+ * )
75+
76+ # Invalid argument
77+ echo " Invalid option"
78+ ;;
6879esac
6980
70- echo " Done!"
81+ echo " Done!"
0 commit comments