MCQ and exercise, 'find' command

Feb 11, 2014 • Jeramia Ory

Question for distinguishing novice from expert:

Using the unix ‘find’ command, a normal user can:

  1. Find any file on the system by name
  2. Find any file in her home directory by name, size or date modified
  3. Directly search for a text string inside the files in her home directory
  4. Find the last time a certain user logged into the system

Question to assess knowledge:

Identify the scenario most appropriate to using the ‘find’ command:

  1. I have a file full of a certain word, and want to find and substitute another word for it inside that file.
  2. There is a rogue process running on my machine, and I want to find it and terminate it.
  3. There is a file I created two weeks ago that I'm pretty sure I saved as 'Nature_paper_rev_final.latex' but can't find it in the usual places.
  4. I want to list all the files in my current directory that end with the extension *.latex </ol>

    Exercise:

    Fill in the appropriate blanks:

    I want to find all files in my Movies directory bigger than 1 Gigabyte

    find ~/Movies ________ +1G

    I want to find all files in my home directory that end in the extension .tmp

    find ~ -name ________

    I want to find all the files in my home directory accessed over 2 months ago

    find ~ _______ +60

    Final exercise:

    Give the command for finding all files in my Music directory with file extension .wav, larger than 50 megabytes, that I haven't accessed in over a year.