Category: BASH
This post shows you 3 interesting/fun BASH commands: BASH Console Tetris Game You can now play tetris game in Bash console. You would need to install this via: $ …
Sometimes we want to repeat a command on Linux, and we can use the following BASH function to repeat a command for a number of times: function repeat() { …
To extract the domain name from a full URL in a Bash script, you can use parameter expansion, sed, awk, or grep. Each method has its own benefits, and …
We can compute the Greatest Common Divisor (GCD) using Iterative Divide/Remainder Method. The following is the GCD implementation in BASH Programming: #!/bin/bash function gcd() { local x=$1 local y=$2 …
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: …