LINUX TP1 need help in programming.
HELLO, I will try to translate this from french into english. So I was given homework, and I am a bit of a nutjob when it comes to programming in linux and would need explanations because I just do not know where to start from.
Display the contents of the file " /proc/meminfo " , it gives the state of the occupation memory:
MemTotal: 807088 kB
MemFree: 13456 kB
Buffers: 95436 kB
Cached: 470396 kB
SwapCached: 0 kB
Active: 377776 kB
Inactive: 339676 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 807088 kB
What we are interested in the first 2 lines (total memory and memory remaining), the size is expressed in kb ( Kilo-bytes)
of after these information, it wants to know the rate of occupation memory.
I need the thing down here in a box...
Mémoire totale : 788,17 Mo
Mémoire occuppée : 775,05 Mo
Mémoire libre : 13,12 Mo
"cat" , "head", "Cut" , "TR" and a script "awk" and for verification
So how exactly to I put it into a script while using awk to build tables and calculate the stuff.
Taux occupation mémoire : 98,34% => Alarm
|