Looking to do a one liner to tell the total amount of free memory on system including swap and cache.free -t isnt an option so i have to do a sum of the values under the free columnI'm not sure how i can get the values, if i use awk how can I reference different numbers in different lines (free Mem is $3, whereas the free swap space for example on a different line is $4)Any ideas ? 
one liner to get memory usage
shell script
on the debian I have in front of me right now, free -t shows a Total: row:             total       used       free     shared    buffers     cachedMem:       8197980    2583348    5614632          0     222508    1904352-/+ buffers/cache:     456488    7741492Swap:      7807584          0    7807584Total:    16005564    2550180   13455384If you just need that row, you could use tail and awk to grab the values.However, if your free does not show this row, you could use awk with RS= to join the lines:free | awk -v RS= '{print $10 + $17 + $21}' | bcIf the column layout of your free is different to mine, you may have to fidget with the field numbers.Explanation:The RS field is the record separator. Setting this to  joins all the lines in the output of free, so awk can reference them as if they were on one 'line'.Counting from the beginning, $1 to $6 are the column headers, $7 is the Mem: row header, $8 to $10 are the values on that row... Therefore $10 is the free memory value. This is done in a similar way for the following values;             total       used       free     shared    buffers     cachedMem:            $8         $9        $10        $11        $12        $13-/+ buffers/cache:        $16        $17Swap:          $19        $20        $21The awk command {print $10 + $17 + $21} basically joins these values with a + in between, and the output is piped to bc to calculate the sum.