Results 1 to 1 of 1
  1. #1

    unixdude45's Avatar
    Member Since
    Dec 22, 2010
    Southern California
    Model Name: iMac Model Identifier: iMac11,2 Processor Name: Intel Core i3 Processor Speed: 3
    Cool How to mimick the "free" command used in Linux in OS X.
    I have a lot of friends who started out learning about unix command line concepts using linux. And many of them are now migrating over to Mac OS X. They are used to using the "free" command to look up ram/memory statistics using terminal in linux.

    I found a python script written for Mac OS X that sort of mimics this command. I normally just use "top", or "vmstat" command myself. However, this is a pretty cool little python script and might be handy in someones OS X terminal toolbox out there.

    I have attached the script. Feel free to tweak it, modify it. Share with us any improvements you can muster. Have fun!

    Just download the program attachment. I called it
    Now be sure to "cd" into the directory that the new file is at.
    For example I placed the file in my Documents2 directory so to get there just enter at the terminal:

    cd /Documents2

    Now you need to change the name to "" to make it usable by the built in python interpreter by using the "mv" command in your terminal:
    sudo mv

    Then make it executable by entering:

    chmod +x

    Now type the following command in your terminal:


    Below I put an example of what the output looks like on my terminal.


    raul-ruizs-imac:documents2 ruizfamily$ python
    Wired Memory: 311 MB
    Active Memory: 555 MB
    Inactive Memory: 387 MB
    Free Memory: 2525 MB
    Real Mem Total (ps): 596.910 MB
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. "Empty the browser's cache" - Can we trigger this command from the server ?
    By michelangelo in forum Web Design and Hosting
    Replies: 3
    Last Post: 07-30-2015, 08:47 AM
  2. "command+shift+P" hotkey doesn't work in Colemak
    By markbellaire in forum macOS - Operating System
    Replies: 2
    Last Post: 04-09-2014, 02:29 PM
  3. OnyX - Push "Command & R" but get 'Do Not Enter' symbol
    By ReelDeal in forum macOS - Apps and Games
    Replies: 1
    Last Post: 12-24-2012, 01:18 PM
  4. Replies: 1
    Last Post: 06-12-2012, 05:39 PM
  5. enable "Duplex Printing Unit" in command prompt?
    By trey5498 in forum macOS - Development and Darwin
    Replies: 3
    Last Post: 01-25-2012, 01:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts