Multiple choice technology operating systems

What command would you use to find all files under the current directory owned by the user foo?

  1. find ./ -type file -user foo

  2. find ./ -type f -owner foo

  3. find ./ -type f -o foo

  4. find ./ -type f -user foo

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The correct syntax uses find with -type f (regular file) and -user foo to match ownership. Option A uses 'file' instead of 'f', Option B uses -owner (nonexistent flag), and Option C uses -o (logical OR) instead of -user. The ./ path is optional but valid.

AI explanation

find ./ -type f -user foo is the correct Unix/Linux command: -type f restricts results to regular files, and -user foo filters to files owned by user foo. -type file is invalid syntax (find uses single-letter codes like f, d, l, not the word 'file'). -owner is not a valid find option (the correct predicate is -user). -o is the logical OR operator in find expressions, not an ownership filter, so -o foo is meaningless. Only the fourth option uses valid, correctly-ordered find syntax.