Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-05-2011, 01:43 AM   #1
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, 01:57 AM   #2
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296

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

Kind regards,

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

Rep: Reputation: 0
For memory checking

I think it will help you out

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


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 09:10 PM
Any memory leak checking tool? George2 Programming 2 06-21-2006 11:26 AM
Easy way of checking fro memory leaks ? qwijibow Programming 2 04-20-2005 06:45 PM
checking memory usage from command line wrepti Linux - General 2 06-16-2004 11:24 PM
checking amount of free memory sanjith11 Linux - Software 6 05-13-2004 11:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:58 AM.

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