XK0-005 · Question #10320
Based on the given command: find /home/user1 -type f -name "*.txt" -size +100M Which of the following will the command accomplish?
The correct answer is D. It finds all the files ending with .txt with a size of over 100MB in /home/user1 directory. The find command with the specified options searches for regular files named *.txt that are larger than 100 megabytes within the /home/user1 directory.
Question
Options
- AIt finds all the files ending with .txt with a size less than 100MB in /home/user1 directory.
- BIt finds all the files ending with .txt with a size of 100MB in /home/user1 directory.
- CIt finds all the directories with .txt files with a size of 100MB in /home folder.
- DIt finds all the files ending with .txt with a size of over 100MB in /home/user1 directory.
How the community answered
(29 responses)- A7% (2)
- C3% (1)
- D90% (26)
Why each option
The `find` command with the specified options searches for regular files named `*.txt` that are larger than 100 megabytes within the `/home/user1` directory.
The `-size +100M` option specifies files *larger than* 100MB, not less than.
The `-size +100M` option specifies files *larger than* 100MB, not exactly 100MB.
The `-type f` option specifically searches for *files*, not directories, and the search path is `/home/user1`, not `/home`.
The `find` command locates files based on specified criteria: `/home/user1` sets the starting directory, `-type f` filters for regular files, `-name "*.txt"` matches files ending with the `.txt` extension, and `-size +100M` correctly identifies files with a size greater than 100 megabytes.
Concept tested: `find` command file searching
Source: https://linux.die.net/man/1/find
Topics
Community Discussion
No community discussion yet for this question.