Quote:
Q : How to I check the file/folder size of Students or Teacher?
|
First, you must log onto your server as root. Then, change directory (cd) to the directory that you want to measure.
Ex.
or
Code:
cd /Students/HPrinter
Next, type
to print the disc usage for the contents of that directory. Please remember that the figure printed is for the contents of the directory where your terminal is pointing (/Students/ or /Students/HPrinter). The figure does not include the size of the pointed to directory, which is a few bytes (~3 bytes)*.
If you want to widen or narrow the scope of your report, you must change to the appropriate directory.
Code:
cd /Students/HPrinter/FirstPeriod
du -hs
To print the disc usage for individual files throughout a file tree rooted at the directory where your terminal is pointing, type
Code:
cd /directory
tree -as | more
tree prints its output in bytes. You will notice I piped ( | ) the output to "more" so that the administrator has a chance to read the output. To limit your search to only non-hidden files and directories.
If you want to print the disc usage for the current directory's contents only, excluding the contents of subdirectories, type
ls also prints its output in bytes. Note: The last number before the date in the printout is the object's disc usage in bytes.
* If you want find the disc usage for a whole tree including the parent directory, change to the parent of the directory in question. Then type
This instance of "du" will print its output in bytes for exactness. For example if you want to know the exact disc usage of "/Students",
Code:
cd /
du -bs Students
will print the disc usage in bytes of everything encompassed by "/Students" including the space used by the directory itself.