UNIX MCQs – Backup and Restore (Part – 3)

UNIX Question and Answer – Backup and Restore

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. Which command in UNIX is used to create a backup archive of files and directories?

a) backup

b) compress

c) tar

d) gzip

Answer: c) tar

Explanation: The tar command in UNIX is commonly used to create backup archives of files and directories.


2. What is the purpose of the -j option in the tar command?

a) Create a backup archive

b) Extract files from a backup archive

c) Compress the archive using bzip2

d) List the contents of the archive

Answer: c) Compress the archive using bzip2

Explanation: The -j option in the tar command is used to compress the archive using the bzip2 compression algorithm.


3. Which command in UNIX is used to create a backup copy of a file with a timestamp appended to its name?

a) backup

b) cp

c) timestamp

d) touch

Answer: d) touch

Explanation: The touch command in UNIX can be used to update the timestamp of a file or create an empty file with a specified timestamp.


4. What does the acronym “SSH” stand for in the context of remote backups in UNIX?

a) Secure Shell

b) System Services Hub

c) Superuser Sharing

d) System Snapshot Handler

Answer: a) Secure Shell

Explanation: SSH (Secure Shell) is a cryptographic network protocol used for secure remote login, remote command execution, and secure file transfer.


5. Which utility in UNIX is used to automate and schedule repetitive backup tasks?

a) cron

b) backupd

c) autosave

d) timekeeper

Answer: a) cron

Explanation: The cron utility in UNIX is used to schedule repetitive tasks, such as backups, at specified intervals.


6. What is the purpose of the -u option in the tar command?

a) Update the contents of an archive

b) Uncompress an archive

c) Untar an archive

d) Use alternate file permissions

Answer: a) Update the contents of an archive

Explanation: The -u option in the tar command is used to update the contents of an existing archive with new or modified files.


7. Which command in UNIX is used to compress files and directories into a single archive?

a) zip

b) compress

c) gzip

d) tar

Answer: d) tar

Explanation: The tar command in UNIX is commonly used to create compressed archives of files and directories.


8. What is the purpose of the -x option in the rsync command?

a) Exclude files from transfer

b) Extract files from an archive

c) Transfer files with extended attributes

d) Execute commands on the remote system

Answer: a) Exclude files from transfer

Explanation: The -x option in the rsync command is used to exclude specific files or directories from the transfer.


9. Which command in UNIX is used to create a backup copy of a file with a timestamp appended to its name?

a) backup

b) cp

c) timestamp

d) touch

Answer: d) touch

Explanation: The touch command in UNIX can be used to update the timestamp of a file or create an empty file with a specified timestamp.


10. What is the purpose of the -z option in the tar command?

a) Compress the archive using gzip

b) Extract files from a compressed archive

c) List the contents of the archive

d) Add files to an existing archive

Answer: a) Compress the archive using gzip

Explanation: The -z option in the tar command is used to compress the archive using the gzip compression algorithm.


11. Which utility in UNIX is used to automate and schedule repetitive backup tasks?

a) cron

b) backupd

c) autosave

d) timekeeper

Answer: a) cron

Explanation: The cron utility in UNIX is used to schedule repetitive tasks, such as backups, at specified intervals.


12. What is the purpose of the -u option in the tar command?

a) Update the contents of an archive

b) Uncompress an archive

c) Untar an archive

d) Use alternate file permissions

Answer: a) Update the contents of an archive

Explanation: The -u option in the tar command is used to update the contents of an existing archive with new or modified files.


13. Which command in UNIX is used to compress files and directories into a single archive?

a) zip

b) compress

c) gzip

d) tar

Answer: d) tar

Explanation: The tar command in UNIX is commonly used to create compressed archives of files and directories.


14. What is the purpose of the -x option in the rsync command?

a) Exclude files from transfer

b) Extract files from an archive

c) Transfer files with extended attributes

d) Execute commands on the remote system

Answer: a) Exclude files from transfer

Explanation: The -x option in the rsync command is used to exclude specific files or directories from the transfer.


15. Which command in UNIX is used to create a backup copy of a file with a timestamp appended to its name?

a) backup

b) cp

c) timestamp

d) touch

Answer: d) touch

Explanation: The touch command in UNIX can be used to update the timestamp of a file or create an empty file with a specified timestamp.


16. What is the purpose of the -z option in the tar command?

a) Compress the archive using gzip

b) Extract files from a compressed archive

c) List the contents of the archive

d) Add files to an existing archive

Answer: a) Compress the archive using gzip

Explanation: The -z option in the tar command is used to compress the archive using the gzip compression algorithm.


17. Which utility in UNIX is used to automate and schedule repetitive backup tasks?

a) cron

b) backupd

c) autosave

d) timekeeper

Answer: a) cron

Explanation: The cron utility in UNIX is used to schedule repetitive tasks, such as backups, at specified intervals.


18. What is the purpose of the -u option in the tar command?

a) Update the contents of an archive

b) Uncompress an archive

c) Untar an archive

d) Use alternate file permissions

Answer: a) Update the contents of an archive

Explanation: The -u option in the tar command is used to update the contents of an existing archive with new or modified files.


19. Which command in UNIX is used to compress files and directories into a single archive?

a) zip

b) compress

c) gzip

d) tar

Answer: d) tar

Explanation: The tar command in UNIX is commonly used to create compressed archives of files and directories.


20. What is the purpose of the -x option in the rsync command?

a) Exclude files from transfer

b) Extract files from an archive

c) Transfer files with extended attributes

d) Execute commands on the remote system

Answer: a) Exclude files from transfer

Explanation: The -x option in the rsync command is used to exclude specific files or directories from the transfer.


21. Which command in UNIX is used to create a backup copy of a file with a timestamp appended to its name?

a) backup

b) cp

c) timestamp

d) touch

Answer: d) touch

Explanation: The touch command in UNIX can be used to update the timestamp of a file or create an empty file with a specified timestamp.


22. What is the purpose of the -z option in the tar command?

a) Compress the archive using gzip

b) Extract files from a compressed archive

c) List the contents of the archive

d) Add files to an existing archive

Answer: a) Compress the archive using gzip

Explanation: The -z option in the tar command is used to compress the archive using the gzip compression algorithm.


23. Which utility in UNIX is used to automate and schedule repetitive backup tasks?

a) cron

b) backupd

c) autosave

d) timekeeper

Answer: a) cron

Explanation: The cron utility in UNIX is used to schedule repetitive tasks, such as backups, at specified intervals.


24. What is the purpose of the -u option in the tar command?

a) Update the contents of an archive

b) Uncompress an archive

c) Untar an archive

d) Use alternate file permissions

Answer: a) Update the contents of an archive

Explanation: The -u option in the tar command is used to update the contents of an existing archive with new or modified files.


25. Which command in UNIX is used to compress files and directories into a single archive?

a) zip

b) compress

c) gzip

d) tar

Answer: d) tar

Explanation: The tar command in UNIX is commonly used to create compressed archives of files and directories.


26. In UNIX, which command is used to create a backup archive of files and directories while preserving their permissions and ownership?

a) backup

b) tar

c) gzip

d) rsync

Answer: b) tar

Explanation: The tar command in UNIX is commonly used to create backup archives while preserving permissions and ownership.


27. What is the primary purpose of using compression when creating backup archives?

a) To reduce storage space requirements

b) To increase backup speed

c) To encrypt the backup data

d) To ensure data integrity

Answer: a) To reduce storage space requirements

Explanation: Compression reduces the size of backup archives, thereby reducing storage space requirements.


28. Which option in the tar command is used to specify the file or directory to be included in the backup archive?

a) -c

b) -f

c) -v

d) -x

Answer: a) -c

Explanation: The -c option in the tar command is used to create a new archive, and it specifies the file or directory to be included.


29. What is the purpose of the -f option in the tar command?

a) To specify the name of the archive file

b) To force the extraction of files

c) To list the contents of the archive

d) To use a specific compression algorithm

Answer: a) To specify the name of the archive file

Explanation: The -f option in the tar command is used to specify the name of the archive file.


30. Which command in UNIX is used to list the contents of a tar archive?

a) list

b) ls

c) tar -l

d) tar -t

Answer: d) tar -t

Explanation: The tar -t command is used to list the contents of a tar archive.


31. What is the purpose of the -v option in the tar command?

a) To verify the integrity of the archive

b) To view detailed information during archive creation

c) To extract files with verbose output

d) To create a new archive

Answer: b) To view detailed information during archive creation

Explanation: The -v option in the tar command is used to display verbose output, providing detailed information during archive creation.


32. Which command in UNIX is used to extract files from a tar archive?

a) extract

b) untar

c) tar -x

d) tar -e

Answer: c) tar -x

Explanation: The tar -x command is used to extract files from a tar archive.


33. What is the purpose of the -p option in the tar command?

a) To preserve file permissions

b) To specify the name of the archive file

c) To compress the archive using gzip

d) To exclude specific files or directories

Answer: a) To preserve file permissions

Explanation: The -p option in the tar command is used to preserve file permissions when extracting files from an archive.


34. Which utility in UNIX is commonly used for incremental backups?

a) tar

b) rsync

c) gzip

d) cp

Answer: b) rsync

Explanation: The rsync utility in UNIX is commonly used for incremental backups, as it only transfers the changes made to files since the last backup.


35. What is the purpose of the -a option in the rsync command?

a) To archive files and directories

b) To authenticate the user

c) To exclude specific files or directories

d) To specify the remote host

Answer: a) To archive files and directories

Explanation: The -a option in the rsync command is used to archive files and directories, preserving permissions, and other metadata.


36. Which command in UNIX is used to synchronize the contents of two directories?

a) sync

b) cp

c) rsync

d) diff

Answer: c) rsync

Explanation: The rsync command in UNIX is commonly used to synchronize the contents of two directories efficiently.


37. What is the purpose of the -n option in the rsync command?

a) To perform a dry run

b) To specify the remote host

c) To exclude specific files or directories

d) To perform a non-recursive sync

Answer: a) To perform a dry run

Explanation: The -n option in the rsync command is used to perform a dry run, displaying the actions that would be taken without actually performing them.


38. Which command in UNIX is used to compress files using the gzip compression algorithm?

a) zip

b) compress

c) gzip

d) tar

Answer: c) gzip

Explanation: The gzip command in UNIX is used to compress files using the gzip compression algorithm.


39. What is the purpose of the -r option in the gzip command?

a) To specify the compression ratio

b) To remove the original file after compression

c) To recursively compress files in subdirectories

d) To restrict access to the compressed file

Answer: b) To remove the original file after compression

Explanation: The -r option in the gzip command is used to remove the original file after compression.


40. Which command in UNIX is used to decompress files compressed with gzip?

a) unzip

b) uncompress

c) gunzip

d) tar

Answer: c) gunzip

Explanation: The gunzip command in UNIX is used to decompress files compressed with gzip.


41. What is the purpose of the -k option in the gzip command?

a) To keep the original file after compression

b) To specify the compression level

c) To compress files in a directory recursively

d) To restrict access to the compressed file

Answer: a) To keep the original file after compression

Explanation: The -k option in the gzip command is used to keep the original file after compression.


42. Which command in UNIX is used to create a compressed tar archive?

a) zip

b) compress

c) tar -z

d) tar -c | gzip

Answer: d) tar -c | gzip

Explanation: The tar -c | gzip command is used to create a compressed tar archive using gzip compression.


43. What is the purpose of the -j option in the tar command?

a) To compress the archive using bzip2

b) To create a backup archive

c) To list the contents of the archive

d) To extract files from a backup archive

Answer: a) To compress the archive using bzip2

Explanation: The -j option in the tar command is used to compress the archive using the bzip2 compression algorithm.


44. Which command in UNIX is used to extract files from a compressed tar archive?

a) unzip

b) uncompress

c) gunzip

d) tar -x

Answer: d) tar -x

Explanation: The tar -x command is used to extract files from a compressed tar archive.


45. What is the purpose of the -C option in the tar command?

a) To specify the compression algorithm

b) To create a new archive

c) To change to a specific directory before performing operations

d) To exclude specific files or directories

Answer: c) To change to a specific directory before performing operations

Explanation: The -C option in the tar command is used to change to a specific directory before performing operations like creating or extracting an archive.


46. Which command in UNIX is used to create a backup archive of files and directories while preserving their permissions and ownership?

a) backup

b) tar

c) gzip

d) rsync

Answer: b) tar

Explanation: The tar command in UNIX is commonly used to create backup archives while preserving permissions and ownership.


47. What is the primary purpose of using compression when creating backup archives?

a) To reduce storage space requirements

b) To increase backup speed

c) To encrypt the backup data

d) To ensure data integrity

Answer: a) To reduce storage space requirements

Explanation: Compression reduces the size of backup archives, thereby reducing storage space requirements.


48. Which option in the tar command is used to specify the file or directory to be included in the backup archive?

a) -c

b) -f

c) -v

d) -x

Answer: a) -c

Explanation: The -c option in the tar command is used to create a new archive, and it specifies the file or directory to be included.


49. What is the purpose of the -f option in the tar command?

a) To specify the name of the archive file

b) To force the extraction of files

c) To list the contents of the archive

d) To use a specific compression algorithm

Answer: a) To specify the name of the archive file

Explanation: The -f option in the tar command is used to specify the name of the archive file.


50. Which command in UNIX is used to list the contents of a tar archive?

a) list

b) ls

c) tar -l

d) tar -t

Answer: d) tar -t

Explanation: The tar -t command is used to list the contents of a tar archive.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...