Scripting

Ten Cool Coreutils Commands

While a few commands, such as ‘cd’ are built directly into bash; many of the most important commands come from coreutils, a GNU package containing over a hundred commands. Some are the well known commands such as ‘ls’, ‘mv’ and ‘cat’. While there are some more obscure ones that are not always discovered because there…

Read More
Linux

Root Check

Sometime it is useful to determine if a script is being run as root or not. A simple check can be performed at the start of a script before anything important is done. The bit of code below will do this. # Check the script is being run by root if [ “$(id -u)” !=…

Read More