Find the 10 largest files

Useful command, if you ever need to, and if you admin Linux you might have to more often than you want to, find the 10 largest files on disk!

$find / -type f -exec du {} \; 2>/dev/null | sort -n | tail -n 10 | xargs -n 1 du -h 2>/dev/null

and thats it!

Use ‘standard’ Powershell to query SCVMM & Hyper-V

I came across this issue recently; not a biggie, but for the life of me couldn’t work why a simple scheduled PS Script wouldn’t return the info I wanted, when it worked in the SCVMM PowerShell Console.

Turns out that that the version of PowerShell called from the SCVMM console includes an important snap-in not loaded by default. To convert a standard PS Script to run against SCVMM simply load the following snap-in:

Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager

You will then be able to process all the Hyper-V commands. Pretty simple really but tripped me up for a bit.

A free Microsoft guide to managing Virtual Machines via SCVMM and PowerShell can be found at: http://bit.ly/ecAD5M