Category: AWK programming
On Linux, we can cat the file “/proc/meminfo” to display memory related information: $ cat /proc/memoinfo MemTotal: 32939372 kB MemFree: 31155452 kB MemAvailable: 31269760 kB Buffers: 242964 kB Cached: …
The inbuilt BASH does not support floating point arithmetic calculations but we can easily declare a function to do so via AWK. #!/bin/bash # calc.sh function calc() { awk …
The following BASH script uses the ping command and computes the average PING to a domain via awk text processing. #!/bin/bash if ]; then echo Usage: $0 domain exit …
Disk high usage are one of the common cause of server down. Some administrators would create a 8GB empty file, and once the disk usage is exceeding a threshold, …
This is the longest Linux shell command I’ve written! Last time, we presented the bash/awk command line prints the block number and the number of hours since last time …