Answers for "thelinuxterminal.com grep command"

0

thelinuxterminal.com grep command

cat file.txt |awk   '{print $(NF-1) }'
Posted by: Guest on August-19-2021
0

thelinuxterminal.com grep command

sudo awk '{print $NF}
Posted by: Guest on August-19-2021
0

thelinuxterminal.com grep command

#!/bin/bash 
subject="Memory Alert"
from="[email protected]"
to="[email protected]"

free=$(free -mt | grep Total | awk '{print $4}')

if [[ "$free" -le 100  ]]; then
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | awk 'NR<=5'
    | head >/tmp/memeorydata.txt

file=/tmp/memeorydata.txt

echo -e "Warning, server memory is running low!\n\n
    Free memory: $free MB" |

mailx -a "$file" -s "$subject" -r "$from" -c "$to"

fi
exit 0
Posted by: Guest on August-19-2021
0

thelinuxterminal.com grep command

cat file.txt |awk   '{print $NF}'
Posted by: Guest on August-19-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language