du -hx
du -hx /dir or mountpoint will display all the subsequent directories and their size. e.g
8.0K /usr/share/locale/got/LC_MESSAGES 8.0K /usr/share/locale/ie/LC_MESSAGES 8.0K /usr/share/locale/fiu/LC_MESSAGES 8.0K /usr/share/locale/kaa/LC_MESSAGES 7.8M /usr/share/locale/fr/LC_MESSAGES 8.0K /usr/share/locale/ii/LC_MESSAGES 96K /usr/share/locale/es_PR/LC_MESSAGES I want use command du -hx /dir then grep output of dir whose size is in Gb or G. Plz tell me how to do it. |
Code:
# du -hx /dir/ | sort -h | grep -i '^[0-9]*\.\?[0-9]*G' Code:
# du -hx /dir/ | sort -h | grep -Ei '^[0-9]*.?[0-9]*G' Code:
# du -hx /dir/ | sort -h | grep -Pi '^\d*.?\d*G' |
Why you want use du -hx /dir you can use simple #du -hs /dir command for the size in GB and MB.
|
All times are GMT -5. The time now is 02:14 AM. |