nerdexam
LPI

010-150 · Question #16

Which commands will archive /home and its content to /mnt/backup? (Choose TWO correct answers.)

The correct answer is A. cp -ar /home /mnt/backup D. tar -cf /mnt/backup/archive.tar /home. Both cp -ar and tar -cf can archive a directory with its contents to a backup location without destroying the source.

Legal, Professional, and Ethical Responsibilities

Question

Which commands will archive /home and its content to /mnt/backup? (Choose TWO correct answers.)

Options

  • Acp -ar /home /mnt/backup
  • Bmv /home /mnt/backup
  • Csync -r /home /mnt/backup
  • Dtar -cf /mnt/backup/archive.tar /home
  • Ecopy -r /home /mnt/backup

How the community answered

(62 responses)
  • A
    71% (44)
  • B
    5% (3)
  • C
    8% (5)
  • E
    16% (10)

Why each option

Both `cp -ar` and `tar -cf` can archive a directory with its contents to a backup location without destroying the source.

Acp -ar /home /mnt/backupCorrect

`cp -a` copies recursively while preserving file attributes (permissions, timestamps, symlinks), and `-r` ensures recursive copying, creating a full copy of /home under /mnt/backup.

Bmv /home /mnt/backup

`mv` moves the directory rather than archiving it, which would destroy the source at /home rather than creating a backup copy.

Csync -r /home /mnt/backup

`sync` flushes filesystem write buffers to disk and is not used for copying or archiving directory trees.

Dtar -cf /mnt/backup/archive.tar /homeCorrect

`tar -cf` creates a new tar archive file at the specified path containing all files and directories under /home, making it a standard archiving solution.

Ecopy -r /home /mnt/backup

`copy` is not a standard Linux command; the correct command for copying files is `cp`.

Concept tested: Linux directory archiving with cp and tar commands

Source: https://man7.org/linux/man-pages/man1/tar.1.html

Topics

#cp command#tar command#backup#archive operations

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice