Check large files or folders on your Magento or Linux folders

Here is the simple tricks and number of commands to find out the disk space used on your Linux server

First of all check size of the whole server disk space by using the following simple command -:

df -h

The output should look like this -:

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 98G 89G 9.4G 91% /
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 138M 1.3G 10% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/sda1 497M 197M 301M 40% /boot
tmpfs 285M 0 285M 0% /run/user/0
tmpfs 285M 0 285M 0% /run/user/1000

Now you can check which folders are large in size by running the following command on the root or any folder on your Linux server -:

du -cks * | sort -rn | head

The output should look like this -:

7958912 total
3043448 home
2370276 usr
2275160 var
167264 boot
83356 opt
17720 etc
1532 run
148 tmp
4 root

You can run the above command on any of the above large folders like home, usr and var.

If you want to further check top 20 folders which are larger in size then you can run the following command on the root or any folder on your Linux server -:

du -m * | sort -nr | head -n 20

The output should look like this -:

2972 home/magento
2972 home
2471 home/magento/public_html
2315 usr
2286 var
2035 var/log
1918 home/magento/public_html/media
1859 home/magento/public_html/media/catalog
1857 home/magento/public_html/media/catalog/product
692 home/magento/public_html/media/catalog/product/cache
688 home/magento/public_html/media/catalog/product/cache/1
626 usr/share
580 usr/lib
437 usr/bin
433 home/magento/mail
390 home/magento/public_html/media/catalog/product/cache/1/thumbnail
332 usr/lib/modules
285 usr/lib64
274 home/magento/public_html/media/catalog/product/cache/1/image
262 home/magento/public_html/media/catalog/product/cache/1/thumbnail/9df78eab33525d08d6e5fb8d27136e95 

That’s it, Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Discover more from WHO WILL CARE eCommerce

Subscribe now to keep reading and get access to the full archive.

Continue reading