Results 1 to 10 of 22
Hi,
I have a folder named "test" with many subfolders and files and with in it.
What is the command to determine the total size of the folder name "test",including ...
- 07-08-2005 #1Just Joined!
- Join Date
- Jun 2005
- Posts
- 8
Determine the folder size
Hi,
I have a folder named "test" with many subfolders and files and with in it.
What is the command to determine the total size of the folder name "test",including the subfolders and files,in bytes ?
Could any one help me on this ?
Thanks,
Nithya
- 07-08-2005 #2
- 07-08-2005 #3Linux Newbie
- Join Date
- Jul 2005
- Location
- Chd,India
- Posts
- 135
try stat filename for complete info on file
along with sizeThe strong shall live and the weak will die
In the end,only the fittest survive in this world
- Shishio Makoto
- 07-09-2005 #4Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
du shows the size in blocks, which is a more accurate representation of the space occupied by files. wc -c will give the size of individual files in bytes. BTW, they're called directories in UNIX/Linux. not folders; that's a Windoze abomination.
- 07-09-2005 #5Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
And that is Unix (not UNIX) and GNU/Linux to you, Sir!
Originally Posted by scm 
Anyway, I can't deny that I agree with you. Make of it what you will, but here's a discussion on this from two and a half years back: http://www.linuxforums.org/forum/topic-217.html
To add something on-topic to this discussion, I might as well say that, to replicate what `du' does when it counts actual blocks, see the st_blocks and st_blksize elements of the return struct used when calling stat(2) on a file. st_blocks returns the number of blocks a file takes up, and st_blksize returns the blocksize of the filesystem that the file resides on. In other words, to get the effective space a file occupies, multiply st_blocks and st_blksize with each other.
I have no idea what ReiserFS returns here when tail packing.
- 07-09-2005 #6Linux User
- Join Date
- Oct 2004
- Location
- /dev/random
- Posts
- 404
http://www.die.net/doc/linux/man/man1/du.1.htmlCode:$du -ah /path/to/dir
-a : all files
-h : human-readable formThe Unforgiven
Registered Linux User #358564
- 07-09-2005 #7Ask Dolda2000 a question, he'll tell you the system call.
Originally Posted by Dolda2000
- 07-09-2005 #8Linux Enthusiast
- Join Date
- Jan 2005
- Posts
- 575
du -b will give you the size in bytes.But it seems
to be Linux specific.
I have no idea what this meansI have no idea what ReiserFS returns here when tail packing.
By the way I read the other thread.Who was that wassy121 who was
threatening to lock it ? Was he a mod back then ?
- 07-09-2005 #9
I think he used to be one.
- 07-09-2005 #10Linux Enthusiast
- Join Date
- Jan 2005
- Posts
- 575
Why isn't he anymore ? Was he demoted or something ?



