logo
  • मेजबानी
    Web Hostingवेब होस्टिंग Web Hostingवर्डप्रेस होस्टिंग Reseller hostingमेजबानी को दुबारा बेचने वाला
  • वीपीएस
    vpsलिनक्स वीपीएस aapanel vpsएएपैनल वीपीएस
  • विंडोज वीपीएस
    windows rdpविंडोज वीपीएस trading vpsट्रेडिंग वीपीएस
  • डोमेन
    domain registerडोमेन रजिस्टर domain transferडोमेन स्थानांतरण domain whoisडोमेन हूइस
  • के बारे में
    contact usसंपर्क करें about usहमारे बारे में blogब्लॉग
  • लॉग इन करें
  • Hindi
    EnglishEnglish arabicArabic KurdishKurdish ItalyItaly TurkishTurkish
  1. Home
  2. Blog
  3. Centos clean up disk space

Centos clean up disk space

Rozhgur Rozhgur, 17 Mar 2022 | time 4 minutes read | 101 Views
Centos clean up disk space

If you've found this page, it's most likely because you're seeking for a solution to free up some disk space on a CentOS 6 or CentOS 7 or CentOS 8 system.


In this post, I'll try to highlight several simple ways that may be readily executed using the command-line / terminal to complete such tasks; each command has been tried on a CentOS 6 or CentOS 7 or CentOS 8 system, but the majority of them will also function on any other Linux environment.


The following are quick commands to clear disk space on CentOS 6 or CentOS 7 and CentOS 8 servers.


The first step before everything you need to run the below command:


# yum -y install yum-utils

Auto-cleaning your server by executing the below command:


# curl -Ls http://bit.ly/clean-centos-disk-space | sudo bash

Do you like to clear your server manually? So follow the below steps


1. Trim log files:


# find /var -name "*.log" \( \( -size +50M -mtime +7 \) -o -mtime +30 \) -exec truncate {} --size 0 \;

2. Yum cache:


# yum clean all
# rm -rf /var/tmp/yum-*

3. Orphan packages:


# package-cleanup --quiet --leaves | xargs yum remove -y

4. WP CLI caches:


# rm -rf /root/.wp-cli/cache/*
# rm -rf /home/*/.wp-cli/cache/*

5. Old kernels:


# (( $(rpm -E %{rhel}) >= 8 )) && dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)
# (( $(rpm -E %{rhel}) <= 7 )) && package-cleanup --oldkernels --count=2

6. Composer caches:


# rm -rf /root/.composer/cache
# rm -rf /home/*/.composer/cache

7. Core dumps:


# find -regex ".*/core\.[0-9]+$" -delete

8. error_log files (CPanel):


# find /home/*/public_html/ -name error_log -delete

9. NodeJs caches:


# rm -rf /root/.npm /home/*/.npm /root/.node-gyp /home/*/.node-gyp /tmp/npm-*

10. Mock caches:


# rm -rf /var/cache/mock/* /var/lib/mock/*

11. Generic program caches:


# rm -rf /home/*/.cache/*/* /root/.cache/*/* 



*-* IF YOU NEED ANY FURTHER INFORMATION, PLEASE REACH OUR SUPPORT DEPARTMENT *-*


 


Conclusion


That's all there is to it: I genuinely hope that the scripts above will assist you in cleaning up your CentOS drive and freeing up some disk space. If you have any further general-purpose recommendations that may be utilized to complete such a work, please email us and we will gladly add them to this page!



Popular Posts
How to Install / Uninstall ConfigServer eXploit Scanner (cxs)

How to Install / Uninstall ConfigServer eXploit Scanner (cxs)

Rozhgur Rozhgur, 17 Mar 2022 | time 4 minutes read
The CXS is a commercial product, so you need to purchase a license from their... Read More
How to unblock IP on WHM - Reseller website

How to unblock IP on WHM - Reseller website

Rozhgur Rozhgur, 07 May 2022 | time 2 minutes read
How to unblock IP on WHM - Reseller website A firewall is commonly built to... Read More
Centos clean up disk space

Centos clean up disk space

Rozhgur Rozhgur, 17 Mar 2022 | time 4 minutes read
If you've found this page, it's most likely because you're seeking for a solution to... Read More
Regxa

REGXA की स्थापना वेब होस्टिंग सेवाओं में मूल्य, गति, गुणवत्ता और बुद्धिमान कार्यान्वयन का विश्व का सर्वश्रेष्ठ संयोजन प्रदान करने के लिए की गई थी।

  • Facebook
  • twitter
  • Linkedin
  • youtube
4.9 Average 294 Reviews
वेब होस्टिंग
  • cPanel होस्टिंग
  • वर्डप्रेस होस्टिंग
  • लारवेल होस्टिंग
  • NodeJs होस्टिंग
  • मेजबानी को दुबारा बेचने वाला
वीपीएस
  • वीपीएस होस्टिंग
  • लिनक्स वीपीएस
  • विंडोज वीपीएस
  • ट्रेडिंग वीपीएस
  • एएपैनल वीपीएस
डोमेन
  • डोमेन रजिस्टर
  • डोमेन स्थानांतरण
  • डोमेन हूइस
कंपनी
  • हमारे बारे में
  • संपर्क करें
  • उपयोग की शर्तें
  • सक्रिय रहने की अवधि
© 2022 - रेगक्सा लिमिटेड। सर्वाधिकार सुरक्षित।
Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Bitcoin Tether ethereum shiba inu Doge Lite Coin XRP ADA