nerdexam
CompTIA

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.

System Management

Question

Based on the given command: find /home/user1 -type f -name "*.txt" -size +100M Which of the following will the command accomplish?

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)
  • A
    7% (2)
  • C
    3% (1)
  • D
    90% (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.

AIt finds all the files ending with .txt with a size less than 100MB in /home/user1 directory.

The `-size +100M` option specifies files *larger than* 100MB, not less than.

BIt finds all the files ending with .txt with a size of 100MB in /home/user1 directory.

The `-size +100M` option specifies files *larger than* 100MB, not exactly 100MB.

CIt finds all the directories with .txt files with a size of 100MB in /home folder.

The `-type f` option specifically searches for *files*, not directories, and the search path is `/home/user1`, not `/home`.

DIt finds all the files ending with .txt with a size of over 100MB in /home/user1 directory.Correct

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

#find command#file searching#command-line utilities#file system management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice