nerdexam
CompTIA

XK0-004 · Question #466

A systems administrator would like to back up all of the'. conf' files on a server The administrator runs the command: Find / --name `'*conf'' > backup,tar After investigating the backup, tar file…

The correct answer is A. find / -name ''*conf'' | xargs -- verbose tar xvf backup,tar. The original command find / -name 'conf' > backup.tar only redirected a list of filenames into a file - it did not archive any file contents. The correct solution is C: find / -name 'conf' | cpio -o --format=tar > backup.tar. Here, find outputs the list of matching files, which…

Scripting, Containers and Automation

Question

A systems administrator would like to back up all of the'. conf' files on a server The administrator runs the command:

Find / --name `'*conf'' > backup,tar After investigating the backup, tar file the administrator realizes that the contents of the configuration files were not backed up property. Which of the following would BEST accomplish this task?

Options

  • Afind / -name ''*conf'' | xargs -- verbose tar xvf backup,tar
  • Bfind/ -name ''*conf'' exec echo { } ; > backup.tar
  • Cfind / -name ''*conf'' | cpio -o --format=tar > backup.tar
  • Dtar -jtf -<<$(find /-name ''*conf'')

How the community answered

(36 responses)
  • A
    75% (27)
  • B
    14% (5)
  • C
    3% (1)
  • D
    8% (3)

Explanation

The original command find / -name '*conf' > backup.tar only redirected a list of filenames into a file - it did not archive any file contents. The correct solution is C: find / -name '*conf' | cpio -o --format=tar > backup.tar. Here, find outputs the list of matching files, which is piped to cpio -o (output/create mode) with --format=tar, producing a proper tar-format archive containing the actual file contents. Option A is marked correct but contains tar xvf (extract flag), which would attempt to extract rather than create a backup - this appears to be a typo in the exam; it should likely read tar cvf. Option B only echoes filenames. Option D's syntax is malformed and non-functional.

Topics

#find command#cpio#backup#file archiving

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice