One liner to show CPU, RAM and HDD usage

Karl Morrison

I've seen a few posts wanting the same regarding usage, however the answers ALWAYS refer to installing some third party tool.

I do not want to install anything.

Any one liners? The following would be a nice output:

CPU 11% RAM 20% HDD 85%
MKay

You can use this

echo "CPU `LC_ALL=C top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}'`% RAM `free -m | awk '/Mem:/ { printf("%3.1f%%", $3/$2*100) }'` HDD `df -h / | awk '/\// {print $(NF-1)}'`"

The output is

CPU 7.4% RAM 33.9% HDD 94%

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

how to find the percentage of CPU, RAM And memory usage using Batch FIle

分類Dev

Android - Handset built in Developer Tools - "Show Cpu Usage" option meaning?

分類Dev

One liner variable declaration

分類Dev

CPU、RAM、HDDの使用状況を示す1つのライナー

分類Dev

CPU、RAM、HDDの使用状況を示す1つのライナー

分類Dev

Measuring RAM usage of a program

分類Dev

AWS Configure Bash One Liner

分類Dev

One liner to uppercase first letter?

分類Dev

MySQL high CPU usage

分類Dev

CPUコアとRAM

分類Dev

Is there a one-liner to convert '1234567' into ['1234', '567', '', '']?

分類Dev

python one liner for creating dictionary from list

分類Dev

Laravel: Better way to update database (one liner)?

分類Dev

integrate head in a one-liner bash CLI

分類Dev

Syntax error with Python one-liner

分類Dev

One Liner sed date string to unixtime

分類Dev

show disk usage

分類Dev

Generate alert on high CPU usage

分類Dev

Jenkins High CPU Usage Khugepageds

分類Dev

Get CPU usage IOS Swift

分類Dev

Calculating CPU usage for all PIDs

分類Dev

Heavy CPU Usage by scrapy crawler

分類Dev

'htop' process and threads cpu usage?

分類Dev

How does Motherboard and CPU affect RAM choice?

分類Dev

Curl: one-liner to test http/2 support

分類Dev

Curl: one-liner to test http/2 support

分類Dev

Bash Scripting: variable value not updating in "one-liner" script

分類Dev

Meaning of this cmd one-liner that pretty prints %PATH%

分類Dev

One-liner in ubuntu/macos to print checksum of a file