New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

How to mimick the "free" command used in Linux in OS X.


Post Reply New Thread Subscribe

 
Thread Tools
unixdude45

 
unixdude45's Avatar
 
Member Since: Dec 22, 2010
Location: Southern California
Posts: 5
unixdude45 is on a distinguished road
Mac Specs: Model Name: iMac Model Identifier: iMac11,2 Processor Name: Intel Core i3 Processor Speed: 3

unixdude45 is offline
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 free.py.txt
Now be sure to "cd" into the directory that the new free.py 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 "free.py" to make it usable by the built in python interpreter by using the "mv" command in your terminal:
sudo mv free.py.txt free.py

Then make it executable by entering:

chmod +x free.py

Now type the following command in your terminal:

python free.py

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

Enjoy!

raul-ruizs-imac:documents2 ruizfamily$ python free.py
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
File Type: txt free.py.txt (1.3 KB, 11 views)
QUOTE Thanks

Post Reply New Thread Subscribe


« How do I get rid of duplicated mailboxes? | Problem with installing Virtual Pc 7 For Mac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Best Linux on Mac? Best Way to Install? markw10 Running Windows (or anything else) on your Mac 9 12-23-2011 11:13 PM
Booting Linux PPC from a USB Drive on my PowerBook edokid Running Windows (or anything else) on your Mac 5 06-23-2011 05:53 PM
What is your opinion on the future of Linux and the Mac? RickR Schweb's Lounge 17 05-09-2008 05:47 AM
Macbook - Linux triple boot issues - HELP jhquest Running Windows (or anything else) on your Mac 2 10-02-2007 10:55 PM
XP, Vista, Ubuntu and then back home Kenotic Switcher Hangout 20 03-02-2007 01:29 AM

All times are GMT -4. The time now is 03:39 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?