Use free with '-s' option to get a continuous update of memory usage info

Free command gives a concise information of the memory usage of the system. The program displays the info once and exits. You can use the ‘-s’ option to update the output continuously. Unlike top command, free doesn’t use ncurses, hence instead of a page refresh emulation its simply continuous printing. But it sure does the job.

Along with the ‘-s’ option you need to specify the result delay duration in seconds; decimal works too.

[shredder12]$ free -s 3

             total       used       free     shared    buffers     cached
Mem:   2516       1322       1194          0         69        506
-/+ buffers/cache: 746       1770
Swap:  1906          0         1906

             total       used       free     shared    buffers     cached
Mem:   2516       1332       1184          0         69        506
-/+ buffers/cache: 751       1765
Swap:  1906          0          1906

             total       used       free     shared    buffers     cached
Mem:   2516       1320       1196          0         69        506
-/+ buffers/cache: 744       1772
Swap:  1906          0          1906

2 Comments

angelblade (not verified)
April 14th, 2011 01:23 am
Hi!! An Alternative way is using watch Sample watch -n free <--- where n is delay in seconds
April 14th, 2011 02:00 am

That's a brilliant method! thanks :)

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Use syntax $$latex$$ to insert LaTeX formulas.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.