Question for distinguishing novice from expert:
Using the unix ‘find’ command, a normal user can:
- Find any file on the system by name
- Find any file in her home directory by name, size or date modified
- Directly search for a text string inside the files in her home directory
- 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:
- I have a file full of a certain word, and want to find and substitute another word for it inside that file.
- There is a rogue process running on my machine, and I want to find it and terminate it.
- 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.
-
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.