LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2011, 12:43 AM   #1
balakodoth
Member
 
Registered: Dec 2010
Posts: 40

Rep: Reputation: 0
checking memory in Linux


I need to creat a swap file using swapon command , but before that I need to check the free memory available .any idea on how can I do this check through shell script. ?
 
Old 01-05-2011, 12:57 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Have a look at the command:
Code:
free
I'm sure it'll tell you what you need to know.

Kind regards,

Eric
 
Old 01-05-2011, 12:57 AM   #3
munavar
LQ Newbie
 
Registered: Dec 2010
Posts: 7

Rep: Reputation: 0
For memory checking

I think it will help you out

#!/bin/bash
FMEM=`free -m | grep Mem | awk {'print $4'}`
echo Free Memory: $FMEM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Checking amount of system memory yaplej Programming 2 11-08-2010 08:10 PM
Any memory leak checking tool? George2 Programming 2 06-21-2006 10:26 AM
Easy way of checking fro memory leaks ? qwijibow Programming 2 04-20-2005 05:45 PM
checking memory usage from command line wrepti Linux - General 2 06-16-2004 10:24 PM
checking amount of free memory sanjith11 Linux - Software 6 05-13-2004 10:11 AM


All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration