Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA216      CA249      CA318

CA400      CA651      CA668


Linux Quiz 3

NOT for marks. Just for practice.
I give this in the style of a form in which you can organise your answers. But N.B. There is nowhere to "submit" to. Your answers are lost when you log out.
If you want to keep your answers, save them in a text file.


  1. Go into my Shakespeare directory. How many sub-directories does it have?

  2. List all files called complete.html one level down from this directory.

  3. Find Act 3 of Macbeth. The size of this file is what?

  4. List all "Act 6" files in all plays.

  5. From your home directory, list all the "Act 6" files without changing directory.

  

grep

  1. In how many lines of the plays does the string "for Ireland" (exact case) appear?
    Count the number of lines it appears on in the files called complete.html.

  2. In how many different plays does the string "for Ireland" appear?
    Count the number of files it appears in in the files called complete.html.

  3. Show all lines in the complete.html files that contain "Scot" but not "Scots" or "Scotland" or "Scottish".

  4. How many times does the string "Scotland" appear in Act 3 of a Shakespeare play?

    Q. How would you find the answer to the previous using Google?