Find the answer to your Linux question:
Results 1 to 5 of 5
I use this command to give my free memory in my system: free | grep Mem | awk '{ print $4 }' And, I would like to know what's the ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48

    Descompose memory result

    I use this command to give my free memory in my system: free | grep Mem | awk '{ print $4 }'

    And, I would like to know what's the arithmetical math to descompose this result into Gb, Mb and Kbytes.
    For example, If I have 1048577Kbyes

    1048577 / 1024 = 1024,0009 Mb
    1024,0009 / 1024 = 1 Gb

    my result: 1GB, 1Mb, 0Kbytes.

    I would like to make this with and script.

    Help me please!

  2. #2
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48
    anybody help me?

  3. #3
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    anybody help me?
    Your question is a continuation of this thread.

    In that thread, we gave you the tools. We're not likely to write the script for you. If you know nothing about writing bash scripts, then scroogle the following search terms:
    Code:
    bash tutorial
    Good luck! :)
    --
    Bill

    Old age and treachery will overcome youth and skill.

  4. #4
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48
    yes but it's different.
    In my first post i put the total memory in GB, Mb and Kbytes,

    now i would like to make an operation (i don't know to make it!)

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    So now it's time for you to learn about bash and bash scripting.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

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