PhantomShadow
New Member
Greetings to all my fellow nerds (please forgive me if i offend any mods with this post I am not well acquainted with this forum I do not intend to break any rules)
I am just starting to really get acquainted with the use of linux terminal so please forgive my crude macro but I thought I would share this concept with the community. I'm sure many of you will have suggestions or even improvements on this concept.
I am a big fan of STACER <link> https://oguzhaninan.github.io/Stacer-Web/ </link> (link to stacer homepage)
I also enjoy bleachbit <link> https://www.bleachbit.org/ </link> (bleachbit homepage)
that being said those two programs are only useful in cleanup in a GENERAL sense among the cleanup methods that are noob friendly,,,,,,,, I wanted to clean up my system a bit more so I created a crude copy-paste macro that works well with Ubuntu with minor adjustments it should work for almost anyone in other distros.
at the bottom of my copy-paste macro I also left info on resetting your network device because that is often the cause of all kinds of problems ..... without further adieu here is my crude macro that i hope can be useful to the community...........I simply have a text editor file that I copy-paste into terminal after using sudo apt-get clean to get the password out of the way.
sudo apt-get clean &&
sudo dpkg --configure -a &&
sudo apt-get autoclean &&
sudo apt-get autoremove --purge &&
sudo lshw -short -C memory &&
sudo resolvectl flush-caches &&
sync && sudo sysctl -w vm.drop_caches=3 &&
sync && sudo sh -c echo 3 | sudo sysctl vm.drop_caches=3 &&
rm -rf ~/.cache* &&
sudo apt-get -y remove --purge $(deborphan) &&
sudo rm -rf /tmp/* &&
sudo fstrim / &&
sudo journalctl --vacuum-time=1hr &&
sudo systemctl restart NetworkManager
------------------------------------------------------------
Resetting Network Devices in Linux
Resetting network devices in Linux can be done using a few simple terminal commands. Here are the most common methods:
Using Network Manager
For systems using Network Manager, you can restart the service with the following command:
sudo systemctl restart NetworkManager
This command will restart the Network Manager, which manages network connections.
Restarting Networking Service
For systems that do not use Network Manager, you can restart the networking service directly:
sudo /etc/init.d/networking restart
Alternatively, you can use:
sudo systemctl restart networking
Disabling and Enabling Networking
You can also disable and then enable networking using the Network Manager command-line tool:
nmcli networking off
nmcli networking on
Checking Network Status
After resetting, you may want to check the status of your network:
nmcli -o (for Network Manager)
sudo systemctl status networking (for traditional networking service)
These commands will help you reset your network device effectively.
I am just starting to really get acquainted with the use of linux terminal so please forgive my crude macro but I thought I would share this concept with the community. I'm sure many of you will have suggestions or even improvements on this concept.
I am a big fan of STACER <link> https://oguzhaninan.github.io/Stacer-Web/ </link> (link to stacer homepage)
I also enjoy bleachbit <link> https://www.bleachbit.org/ </link> (bleachbit homepage)
that being said those two programs are only useful in cleanup in a GENERAL sense among the cleanup methods that are noob friendly,,,,,,,, I wanted to clean up my system a bit more so I created a crude copy-paste macro that works well with Ubuntu with minor adjustments it should work for almost anyone in other distros.
at the bottom of my copy-paste macro I also left info on resetting your network device because that is often the cause of all kinds of problems ..... without further adieu here is my crude macro that i hope can be useful to the community...........I simply have a text editor file that I copy-paste into terminal after using sudo apt-get clean to get the password out of the way.
sudo apt-get clean &&
sudo dpkg --configure -a &&
sudo apt-get autoclean &&
sudo apt-get autoremove --purge &&
sudo lshw -short -C memory &&
sudo resolvectl flush-caches &&
sync && sudo sysctl -w vm.drop_caches=3 &&
sync && sudo sh -c echo 3 | sudo sysctl vm.drop_caches=3 &&
rm -rf ~/.cache* &&
sudo apt-get -y remove --purge $(deborphan) &&
sudo rm -rf /tmp/* &&
sudo fstrim / &&
sudo journalctl --vacuum-time=1hr &&
sudo systemctl restart NetworkManager
------------------------------------------------------------
Resetting Network Devices in Linux
Resetting network devices in Linux can be done using a few simple terminal commands. Here are the most common methods:
Using Network Manager
For systems using Network Manager, you can restart the service with the following command:
sudo systemctl restart NetworkManager
This command will restart the Network Manager, which manages network connections.
Restarting Networking Service
For systems that do not use Network Manager, you can restart the networking service directly:
sudo /etc/init.d/networking restart
Alternatively, you can use:
sudo systemctl restart networking
Disabling and Enabling Networking
You can also disable and then enable networking using the Network Manager command-line tool:
nmcli networking off
nmcli networking on
Checking Network Status
After resetting, you may want to check the status of your network:
nmcli -o (for Network Manager)
sudo systemctl status networking (for traditional networking service)
These commands will help you reset your network device effectively.

