Deprecated: Hook custom_css_loaded is deprecated since version jetpack-13.5! Use WordPress Custom CSS instead. Jetpack no longer supports Custom CSS. Read the WordPress.org documentation to learn how to apply custom styles to your site: https://wordpress.org/documentation/article/styles-overview/#applying-custom-css in /srv/www/srvfail.com/public_html/wp-includes/functions.php on line 6078
Find which directory is using most inodes ⋆ SysAdminStuff

Find which directory is using most inodes

Oneliners to find which directory on the server is using most inodes:

To find how many inodes are used per each directory on certain path run:

find ./ -maxdepth 1 -type d -print0 | while IFS= read -r -d $'\0' dir; do echo "$(find "$dir" | wc -l) "$dir""; done| sort -n | tail

Last line will show the path being searched and second to last line will be directory with most inodes, then cd to that directory and run again to see which subfolder is using most inodes.

To get directory with most inodes immediately, without the need to cd in each directory you can run following:

find ./ -type d -print0 | while IFS= read -r -d $'\0' dir; do echo "$(stat -t "$dir" | awk '{print$2}') "$dir""; done | sort -n | tail

This will not show the number of inodes used, only which directory has most inodes in it.
Oneliner from top can be used to get exact number of inodes in it.

One thought on “Find which directory is using most inodes”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.