When you view a file or directory in Linux with the long listing of ls, ls -l or perhaps using the command stat we can see the number of hard links to the file or…
I needed this script, or at least a variant of it for a project I was working on for automatic deployments of XenServer using PXE. The XenServers would be set to PXE boot and they would collect…
The output of lastlog is useful and shows you all the users and the date and time of their last login. Firstly though, we need to filter out the system accounts who never login. This is easy…
Now we know how to format the output in color, lets see what we may use this for. Searching though CSV files and highlighting names or products is one option and we will look at a script…
Having driven ourselves loopy for a few lessons now we have to handle interruptions. Making a script robust may include ensuring that certain activities always happen before the script closes; or perhaps, ensuring that only…
The last looping structure we look at is the FOR loop. This is often used to enumerate through a list of items such as in the following code: for U in(bob joe fred) do useradd…