Operating Systems Assignment

159 views 7:39 am 0 Comments October 17, 2023

Question 3

Implement system security and access control in the Linux operating system.

Using Ubuntu OS, write and implement ONE (1) bash shell script (only one script should be written for the whole Question 3). Use the root account to execute the script. The script will be executed with no arguments, and it can be executed in any folder.

The bash shell script should have the following specifications:

Part (a)

1. The script will list the filenames of all image files (excluding hidden image files and image files in sub-folders) in the current folder with the extension of .png and jpg on screen, Note that only the filenames and size (in bytes) should be displayed.

2. It will display the total size (in bytes) of all the ._png and .jpg image files in the current folder.

3. It will then display the following message depending on the total size of all the .png and jpg image files in the current folder.

  •  Less than 5000000 bytes, display “total image size is small”
  •  More than or equal to 5000000 bytes, display “total image size is NOT small”
    (15 marks)
Tags: , , , , , , , , , , ,