Unix: Getting size of a directory

To find out the size of a directory in unix, you can use the following built-in command:

du -sh file_path

Explanation

du command estimates file_path space usage
The options -sh are :

-s, –summarize
display only a total for each argument

-h, –human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

To check more than one directory and see the total, use du -sch:

-c, –total
produce a grand total

If you also would like to know which sub-folders spend how much disk space

du -h --max-depth=1 | sort -hr

Querying Active Directory Information

There are multiple ways of querying for a user’s information from Active Directory. If you are a fan of writing scripts, you can use PowerShell  [AdsiSearcher] type accelerator. However, if you are more of a visual GUI person, you can use DSQuery  tool that’s comes with Windows 7.

To run the tool, open CMD window, and type the following command:

"C:\Windows\System32\rundll32.exe" dsquery.dll,OpenQueryWindow

This will bring up a GUI where you can search active directory for users by their username, email or full names.