Linux commands: Difference between revisions

Jump to navigation Jump to search
1,031 bytes added ,  27 July 2015
No edit summary
Line 246: Line 246:
** namespace: ROOT\CIMV2
** namespace: ROOT\CIMV2
** WQL query: {{kbd | key= SELECT LoadPercentage FROM Win32_Processor}}; No need to divid by CPU cores number for Win8
** WQL query: {{kbd | key= SELECT LoadPercentage FROM Win32_Processor}}; No need to divid by CPU cores number for Win8
** output example: 24 ([https://msdn.microsoft.com/zh-tw/library/system.uint16(v=vs.110).aspx Unsigned Integer]) unit: %
** output example: 24 ([https://msdn.microsoft.com/zh-tw/library/system.uint16(v=vs.110).aspx UInt16, 16 bit Unsigned Integer]) unit: %
* Linux:  
** CPU usage = LoadPercentage; unit: %
* Linux / freebsd / Mac:  
** PHP function [http://php.net/manual/en/function.sys-getloadavg.php sys_getloadavg()] unit: %; Need to divid by CPU cores number
** PHP function [http://php.net/manual/en/function.sys-getloadavg.php sys_getloadavg()] unit: %; Need to divid by CPU cores number


Memory usage
Memory usage
* Windows:
* Windows:
* Linux:  
** namespace: ROOT\CIMV2
** WQL query: {{kbd | key= SELECT FreePhysicalMemory, TotalVisibleMemorySize FROM Win32_OperatingSystem}};
** output example: 21683460 ([https://msdn.microsoft.com/zh-tw/library/system.uint64(v=vs.110).aspx UInt64, 64 bit Unsigned Integer]) unit: KB
** memory usage = (FreePhysicalMemory * 100) / TotalVisibleMemorySize; unit: %
* Linux / freebsd:
** command: {{kbd | key = free}}
** output example:
<pre>
                              total      used      free    shared    buffers    cached
                    Mem:      8060416    7922496    137920        120    183608    526180
                    -/+ buffers/cache:    7212708    847708
                    Swap:      4194300    1219364    2974936
</pre>
** memory usage = 7922496 / 8060416; unit: %
* Mac (Darwin):
** command: {{kbd | key = top -l 1 | grep PhysMem:}}
** output example: PhysMem: 8017M used (1486M wired), 172M unused.
** memory usage: 172 / (8017+172); unit: %


=== Scan the disk ===
=== Scan the disk ===

Navigation menu