I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible?
steve-ss writes:
I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible?
man du Particularly look at the -s option. -Ti
On Friday 01 October 2004 01:37 pm, steve-ss wrote:
I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible?
The command is du (I guess for disk usage). du -s gives you the number of bytes in a given directory counting all subdirectories. du --max-depth will give you the sizes of all the directories in a given directory. The -h options gives human readable output (KB, MB...). Brana
On Friday 01 October 2004 19.37, steve-ss wrote:
I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible? Use "du" "du -s /path to/" for a total sum or "du -sh /path to/" for "human readable" -- /Rikard
------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
steve-ss wrote:
I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible?
du -hs /path/to/directory is what you want man du, for description of the options. Steve
Steve, On Friday 01 October 2004 10:37, steve-ss wrote:
I want to see the size of a directory. That's the directory and all its contents as a single number of bytes. It seems quite basic but man, info and google/linux have given me nothing. Is it possible?
Flatly impossible, of course. And when you follow everyone's advice about using the "du" command, be sure to keep in mind that be default it reports in units of 1024-byte blocks. There are many options for changing this, including the ability to report the number of bytes directly (by telling it to report the number of one-byte "blocks"). "man du" for all the details, of course. Randall Schulz
participants (6)
-
Branimir Vasilic
-
Randall R Schulz
-
Rikard Johnels
-
Stephen
-
steve-ss
-
ti@amb.org