Tuesday, October 18, 2022

Disk space issue- Linux commands

To know disk space

df -h

 follow a top-down approach by looking at the inode count for each main folder, and then drill down to the directory that consumes the most inodes

            find /var -xdev -printf '%h\n' | sort | uniq -c | sort -k1 -rn

 

Once we know the top folders that contributed to the disk overage, we can then drill down to weed out those that are not needed.

 

 du -hm --max-depth=1 | sort -kl,l -nr

 cd /opt/bitnami/magento/htdocs

sudo rm -rf var/cache/*

 sudo rm -rf var/log

sudo rm -rf var/page_cache/*

sudo /opt/bitnami/ctlscript.sh start


bitnami@ip-172-31-88-222:/opt/bitnami/mysql$  sudo chown mysql:root -R /opt/bitnami/mysql/data


No comments:

Post a Comment