CSC 275 - Operating Systems Practicum

Dr. R. M. Siegfried

Assignment #12 - Working with bash

Due Friday, December 16, 2022 (Section 1)

Due Wednesday, December 21, 2022 (Section 2)

  1. Write a shell script (executable command file) that displays the names of all the command-line parameters (it assumes that they are all files) and then gives their directory listing.

    Use ls -ld to ensure that you get the complete listing and that you get it for the directory and not the files in the directory.

  2. The Linux command last lists users in reverse chronological order. Use this together with sort, sed and uniq to get a listing of all the users who have been on the system since the log was last cleared. (Hint: use sed to get rid of everything on the line other than the login name).
  3. The ls command will list the so-called "hidden" files if you use the -a. So, for example, ls -la $HOME will list all the files in your home directory, including the hiddent files, whose names all begin with a period .

    Use this together with the filters that we have learned to get a listing that includes the names of ONLY the hidden files in a directory given as an command-line parameter.

After you get your programs runnings, copy and paste the source code into Notepad as well as the results of a run and hand in hardcopy.

[Back to the Assignment List]