VMware Cloud Community
wilf_williams
Contributor
Contributor
Jump to solution

Directory space usage

Hi all,

I need to know in vmfs how much space a directory uses before I use tar to send it to a tape..

One of my linux guru's wrote this little script, but surely there is a better /native way of doing this ? thanks for any pointers Wilf (Quick and dirty solution follows) #! /bin/bash cd $1 total=`du -caLlk . | grep total | cut -f1` count=`find . -type f | wc -l` echo "$total kb in $count files"

0 Kudos
1 Solution

Accepted Solutions
Chris_Howard
Hot Shot
Hot Shot
Jump to solution

du -sh <directory name>

should do the trick.

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

View solution in original post

0 Kudos
5 Replies
Chris_Howard
Hot Shot
Hot Shot
Jump to solution

du -sh <directory name>

should do the trick.

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!
0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

Hello, are you using ESX 3.x or 3i?

0 Kudos
wilf_williams
Contributor
Contributor
Jump to solution

3.5 But I think that du should dohe trick, Ill pipe it to a file and test to see if itsmaller than 400Gb then stick it on tape.

Wilf

0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

I've moved your post to the ESX Server 3.5 Configuration forum

Dave Mishchenko

VMware Communities User Moderator

0 Kudos
Chris_Howard
Hot Shot
Hot Shot
Jump to solution

Hi - not sure if I fully understood your question - to find the size of a particular single directory, including all subdirectories, the du -sh <directory name> will be fine, but might take a while depending on the number of files.

If you wanted to see total free/ used space on your vmfs volumes, then vdf -h would be quicker.

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!
0 Kudos