Operating Systems

Which command locates a file named backup.tar by searching the directory tree under /home?

Show the answer

Correct answerA. find

AWhy this is right: find searches a directory tree for files matching criteria such as name.

BWhy not this: chown changes file ownership and has no searching function.

CWhy not this: ls lists one directory's contents and does not search the whole tree by name.

DWhy not this: grep searches the contents of files for text, not for files by name.

find walks a directory tree and matches files by name and other attributes. grep searches inside files for text, so it does not locate a file by its name.