HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/find_only_last_dirs_over_1GB.sh
#!/bin/bash


#find `pwd` -mindepth 2 -type d -exec waitmax 5 du -kxsh {} \; | grep -Pi '^[0-9\.]{1,4}[G|T]' | tee /tmp/bigfolders


IFS=$'\n'
for dir in `find $1 -type d` ; do
    ARE_DIRS=`find "$dir" -type d | head -2 | wc -l`
    if [ $ARE_DIRS -eq 1 ] ; then
        du -kxsh "$dir" | grep -Pi '^[0-9\.]{1,4}[G|T]'
    fi
done

unset IFS