8

I need a command to get a output of the load average of linux system to use on a script.

I know the command uptime, but using that command I get all that stuff i don't want, like: 12:09:31 up 20:57, 2 users, load average: 0.12, 0.10, 0.09.

How can I get only the load average on the output?

Like this: load average: 0.11 (for example)

Thank you for your help and sorry my poor english.

  • Have you checked the `/proc` filesystem? Maybe you should? – Some programmer dude Jan 30 '18 at 12:19
  • ty @Someprogrammerdude – Alexandre Carvalho Jan 30 '18 at 12:22
  • 3
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jan 30 '18 at 15:15
  • uptime | awk '{print $8}' – pidloop Sep 08 '22 at 02:34

1 Answers1

12

I just googled and found this.

Hope this helps :

http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

I think this command will solves your question.

cat /proc/loadavg

Enkum
  • 635
  • 8
  • 22