How it works...

First, before digging into the script itself or even the attributes/properties of files, we need to know a few things about Linux and its sibling operating systems:

  • Files and directories can be owned. This means that they can have an owner (user) and groups associated with their ownership. For this, we can use the chown and chgrp commands.
  • Files and directories can have different permissions applied to them. This means that they may be executable, readable, writable, and/or everything. For this, we can use the chmod command and the appropriate permission setting.
  • Files and directories can also be empty.

Great! Furthermore, there are two more concepts that need to be introduced:

  • The read command, which is used to wait for ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.