How to See How Many inodes on Linux Servers?

Share this Article :

In this post, i will share on how to see how many inodes that i used on my servers on Linux server.

What is inodes ?
An inode is a data structure used to keep information about a file on your hosting account. The number of inodes indicates the number of files and folders you have. This includes everything on your account, emails, files, folders, anything you store on the server.
Reference

1. SSH to your server as a root.
2. Please note that this command will view the inodes for a specific folder.

    echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
    

Go to your root directory then run this command :

    [[email protected] ~]# cd /
    [[email protected] /]# echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
    Detailed Inode usage for: /
    116             - bin
    29              - boot
    1               - cgroup
    623             - dev
    1579            - etc
    5               - home
    3598            - lib
    1               - lost+found
    10              - media
    1               - misc
    1               - mnt
    1               - net
    1               - opt
    17533           - proc
    55              - root
    266             - sbin
    1               - selinux
    1               - srv
    8994            - sys
    1               - testfolder
    12              - tmp
    33003           - usr
    12884           - var
    Total:          78719
    

Leave a Reply