Skip to content

Instantly share code, notes, and snippets.

@stknohg
Last active May 2, 2017 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stknohg/71673aa17ca51c140bb4e7405e9fcab6 to your computer and use it in GitHub Desktop.
Save stknohg/71673aa17ca51c140bb4e7405e9fcab6 to your computer and use it in GitHub Desktop.
Bash on Ubuntu on Windowsからロードアベレージを取得するワンライナー
# Windows 10 Creators Update以降でやってね
'cat /proc/loadavg|awk ''{print "@{Load1="$1";Load5="$2";Load15="$3";}"}'';exit;' | bash | iex
# Windows 10 Creators Update以降でやってね
'cat /proc/loadavg;exit;' | bash | % {$v=-split $_;@{Load1=$v[0];Load5=$v[1];Load15=$v[2];}}
@stknohg
Copy link
Author

stknohg commented Apr 27, 2017

実行例)

PS C:\> 'cat /proc/loadavg|awk ''{print "@{Load1="$1";Load5="$2";Load15="$3";}"}'';exit;' | bash | iex

Name                           Value
----                           -----
Load15                         0.59
Load1                          0.52
Load5                          0.58

PS C:\> 'cat /proc/loadavg;exit;' | bash | % {$v=-split $_;@{Load1=$v[0];Load5=$v[1];Load15=$v[2];}}

Name                           Value
----                           -----
Load15                         0.59
Load1                          0.52
Load5                          0.58

@stknohg
Copy link
Author

stknohg commented May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment