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.
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)- A71% (44)
- B5% (3)
- C8% (5)
- E16% (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.
`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.
`mv` moves the directory rather than archiving it, which would destroy the source at /home rather than creating a backup copy.
`sync` flushes filesystem write buffers to disk and is not used for copying or archiving directory trees.
`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.
`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
Community Discussion
No community discussion yet for this question.