find command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    "That English paper you were writing on the works of Lewis Carroll is due in a few hours and you have forgeotten the name of the text file in which you has written a number of quotations to use in your paper. Luckily, you know that the file is somewhere in your ~/UnixCourse directory or in some subdirectory directly or indeirently within it. You also know that the file name ended in '.txt'. You are pretty sure that you could recognize the file from just the first line.

[private thread] Head command Problems
You seem to recall having heard that there is a Unix command head that will print the first few lines of any file and suspect that, with the proper parameters, it could be used to print just the first line. (Hint - part of your task in this question is to show that you can use the built-in Unix help facilities.)

But you really don't want to type that command out for every file or even every directory. What command would you give to produce a listing of the names of all the text files in ~/UnixCourse or its subdirectories (possibly nested several layers deep) followed immediately by the first line of text within that file? E.g., to produce a listing looking like this:

/home/yourname/UnixCourse/foo.txt
When in the course of human development
/home/yourname/UnixCourse/Quotations/bar.txt
Curiouser and curiouser!"

What comman would you enter to list the first lines of all text files within your UnixCourse directory or within any directory inside there?

  1. Relevant commands, code, scripts, algorithms:

Find and Head

  1. The attempts at a solution (include all code and scripts):

I've tried: find ~/UnixCourse *.txt -exec head
And other variants throwing {} here and there.

It's saying this: "Hint: The file Name that head should worlk on is {}, which stands for whatever file 'find' has found.

  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course): ODU Norfolk VA Ziel CS252

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

beginning of find man page:

In your first attempt, where is the boolean expression?

If I were you I would (re-)read again this time paying more attention the man pages and learn some terminologiey like argument, expression etc...

...
Waiting for your next try (good one this time?)