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 compress files using the bzip2 compression algorithm?
a) zip
b) bzip
c) compress
d) bzip2
Answer: d) bzip2
Explanation: The bzip2 command in UNIX is used to compress files using the bzip2 compression algorithm.
2. What is the purpose of the -k option in the bzip2 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 bzip2 command is used to keep the original file after compression.
3. Which command in UNIX is used to decompress files compressed with bzip2?
a) unzip
b) bunzip
c) unbzip2
d) bzcat
Answer: b) bunzip
Explanation: The bunzip command in UNIX is used to decompress files compressed with bzip2.
4. What is the purpose of the -c option in the bzip2 command?
a) To specify the compression level
b) To compress files in a directory recursively
c) To decompress a file and send the output to standard output
d) To create a new compressed file
Answer: c) To decompress a file and send the output to standard output
Explanation: The -c option in the bzip2 command is used to decompress a file and send the output to standard output.
5. Which command in UNIX is used to create a compressed tar archive using bzip2 compression?
a) tar -c | bzip2
b) tar -z
c) tar -j
d) tar -c | gzip
Answer: c) tar -j
Explanation: The tar -j command is used to create a compressed tar archive using bzip2 compression.
6. What is the purpose of the -k option in the tar command?
a) To keep the original file after compression
b) To specify the compression level
c) To create a new archive
d) To exclude specific files or directories
Answer: c) To create a new archive
Explanation: The -k option in the tar command is used to create a new archive.
7. Which command in UNIX is used to list the contents of a bzip2-compressed file?
a) list
b) ls
c) bzlist
d) bzcat
Answer: d) bzcat
Explanation: The bzcat command is used to list the contents of a bzip2-compressed file.
8. What is the purpose of the -l option in the bzcat command?
a) To list the contents of a compressed file
b) To decompress a file and send the output to standard output
c) To create a new compressed file
d) To keep the original file after compression
Answer: b) To decompress a file and send the output to standard output
Explanation: The -l option in the bzcat command is used to decompress a file and send the output to standard output.
9. Which command in UNIX is used to create a compressed archive of a directory using gzip compression?
a) zip
b) compress
c) tar -z
d) tar -c | gzip
Answer: c) tar -z
Explanation: The tar -z command is used to create a compressed archive of a directory using gzip compression.
10. What is the purpose of the -r option in the tar command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the tar command is used to recursively compress files in subdirectories.
11. Which command in UNIX is used to decompress files compressed with gzip?
a) unzip
b) gunzip
c) ungzip
d) gzcat
Answer: b) gunzip
Explanation: The gunzip command in UNIX is used to decompress files compressed with gzip.
12. What is the purpose of the -r option in the gunzip command?
a) To remove the original file after decompression
b) To recursively decompress files in subdirectories
c) To restrict access to the decompressed file
d) To decompress a file and send the output to standard output
Answer: a) To remove the original file after decompression
Explanation: The -r option in the gunzip command is used to remove the original file after decompression.
13. Which command in UNIX is used to create a compressed archive of a directory using gzip compression?
a) zip
b) compress
c) tar -z
d) tar -c | gzip
Answer: c) tar -z
Explanation: The tar -z command is used to create a compressed archive of a directory using gzip compression.
14. What is the purpose of the -r option in the tar command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the tar command is used to recursively compress files in subdirectories.
15. Which command in UNIX is used to decompress files compressed with gzip?
a) unzip
b) gunzip
c) ungzip
d) gzcat
Answer: b) gunzip
Explanation: The gunzip command in UNIX is used to decompress files compressed with gzip.
16. What is the purpose of the -r option in the gunzip command?
a) To remove the original file after decompression
b) To recursively decompress files in subdirectories
c) To restrict access to the decompressed file
d) To decompress a file and send the output to standard output
Answer: a) To remove the original file after decompression
Explanation: The -r option in the gunzip command is used to remove the original file after decompression.
17. Which command in UNIX is used to create a compressed archive of a directory using gzip compression?
a) zip
b) compress
c) tar -z
d) tar -c | gzip
Answer: c) tar -z
Explanation: The tar -z command is used to create a compressed archive of a directory using gzip compression.
18. What is the purpose of the -r option in the tar command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the tar command is used to recursively compress files in subdirectories.
19. Which command in UNIX is used to decompress files compressed with gzip?
a) unzip
b) gunzip
c) ungzip
d) gzcat
Answer: b) gunzip
Explanation: The gunzip command in UNIX is used to decompress files compressed with gzip.
20. What is the purpose of the -r option in the gunzip command?
a) To remove the original file after decompression
b) To recursively decompress files in subdirectories
c) To restrict access to the decompressed file
d) To decompress a file and send the output to standard output
Answer: a) To remove the original file after decompression
Explanation: The -r option in the gunzip command is used to remove the original file after decompression.
21. Which command in UNIX is used to create a compressed archive of a directory using gzip compression?
a) zip
b) compress
c) tar -z
d) tar -c | gzip
Answer: c) tar -z
Explanation: The tar -z command is used to create a compressed archive of a directory using gzip compression.
22. What is the purpose of the -r option in the tar command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the tar command is used to recursively compress files in subdirectories.
23. Which command in UNIX is used to decompress files compressed with gzip?
a) unzip
b) gunzip
c) ungzip
d) gzcat
Answer: b) gunzip
Explanation: The gunzip command in UNIX is used to decompress files compressed with gzip.
24. What is the purpose of the -r option in the gunzip command?
a) To remove the original file after decompression
b) To recursively decompress files in subdirectories
c) To restrict access to the decompressed file
d) To decompress a file and send the output to standard output
Answer: a) To remove the original file after decompression
Explanation: The -r option in the gunzip command is used to remove the original file after decompression.
25. Which command in UNIX is used to create a compressed archive of a directory using gzip compression?
a) zip
b) compress
c) tar -z
d) tar -c | gzip
Answer: c) tar -z
Explanation: The tar -z command is used to create a compressed archive of a directory using gzip compression.
26. What is the purpose of the –delete option in the rsync command?
a) To delete files from the destination that are not present in the source
b) To delete the source files after transfer
c) To delete the destination files before transfer
d) To delete both source and destination files after transfer
Answer: a) To delete files from the destination that are not present in the source
Explanation: The –delete option in the rsync command is used to delete files from the destination that are not present in the source during synchronization.
27. Which command in UNIX is used to create a snapshot of a filesystem for backup purposes?
a) snapshot
b) fsfreeze
c) snapbackup
d) backupfs
Answer: b) fsfreeze
Explanation: The fsfreeze command in UNIX is used to suspend and resume access to a filesystem, allowing for consistent backups.
28. What is the purpose of the -S option in the tar command?
a) To split the archive into multiple files
b) To specify the compression level
c) To preserve file permissions
d) To exclude specific files or directories
Answer: a) To split the archive into multiple files
Explanation: The -S option in the tar command is used to split the archive into multiple files of a specified size.
29. Which command in UNIX is used to create a checksum of a file?
a) chksum
b) md5sum
c) hashsum
d) checksum
Answer: b) md5sum
Explanation: The md5sum command in UNIX is used to calculate and display an MD5 checksum for a file.
30. What is the purpose of the -c option in the md5sum command?
a) To check the checksum of a file
b) To create a new checksum file
c) To compare two checksum files
d) To display the checksum in a different format
Answer: b) To create a new checksum file
Explanation: The -c option in the md5sum command is used to create a new checksum file containing checksums for the specified files.
31. Which command in UNIX is used to verify the integrity of a tar archive?
a) verify
b) tar -v
c) tar -t
d) tar -x
Answer: c) tar -t
Explanation: The tar -t command is used to list the contents of a tar archive, allowing users to verify its integrity.
32. What is the purpose of the -W option in the tar command?
a) To exclude specific files or directories
b) To append files to an existing archive
c) To specify a different working directory
d) To preserve file permissions and ownership
Answer: a) To exclude specific files or directories
Explanation: The -W option in the tar command is used to exclude specific files or directories from the archive.
33. Which command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm?
a) gzip
b) compress
c) zip
d) tar -c | gzip
Answer: c) zip
Explanation: The zip command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm.
34. What is the purpose of the -r option in the zip command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the zip command is used to recursively compress files in subdirectories.
35. Which command in UNIX is used to decompress files compressed with the zip compression algorithm?
a) unzip
b) gunzip
c) uncompress
d) unzip
Answer: a) unzip
Explanation: The unzip command in UNIX is used to decompress files compressed with the zip compression algorithm.
36. What is the purpose of the -q option in the unzip command?
a) To specify the compression level
b) To remove the original file after decompression
c) To perform operations quietly without displaying messages
d) To recursively decompress files in subdirectories
Answer: c) To perform operations quietly without displaying messages
Explanation: The -q option in the unzip command is used to perform operations quietly without displaying messages.
37. Which command in UNIX is used to create a checksum of a file?
a) chksum
b) md5sum
c) hashsum
d) checksum
Answer: b) md5sum
Explanation: The md5sum command in UNIX is used to calculate and display an MD5 checksum for a file.
38. What is the purpose of the -c option in the md5sum command?
a) To check the checksum of a file
b) To create a new checksum file
c) To compare two checksum files
d) To display the checksum in a different format
Answer: b) To create a new checksum file
Explanation: The -c option in the md5sum command is used to create a new checksum file containing checksums for the specified files.
39. Which command in UNIX is used to verify the integrity of a tar archive?
a) verify
b) tar -v
c) tar -t
d) tar -x
Answer: c) tar -t
Explanation: The tar -t command is used to list the contents of a tar archive, allowing users to verify its integrity.
40. What is the purpose of the -W option in the tar command?
a) To exclude specific files or directories
b) To append files to an existing archive
c) To specify a different working directory
d) To preserve file permissions and ownership
Answer: a) To exclude specific files or directories
Explanation: The -W option in the tar command is used to exclude specific files or directories from the archive.
41. Which command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm?
a) gzip
b) compress
c) zip
d) tar -c | gzip
Answer: c) zip
Explanation: The zip command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm.
42. What is the purpose of the -r option in the zip command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the zip command is used to recursively compress files in subdirectories.
43. Which command in UNIX is used to decompress files compressed with the zip compression algorithm?
a) unzip
b) gunzip
c) uncompress
d) unzip
Answer: a) unzip
Explanation: The unzip command in UNIX is used to decompress files compressed with the zip compression algorithm.
44. What is the purpose of the -q option in the unzip command?
a) To specify the compression level
b) To remove the original file after decompression
c) To perform operations quietly without displaying messages
d) To recursively decompress files in subdirectories
Answer: c) To perform operations quietly without displaying messages
Explanation: The -q option in the unzip command is used to perform operations quietly without displaying messages.
45. Which command in UNIX is used to create a checksum of a file?
a) chksum
b) md5sum
c) hashsum
d) checksum
Answer: b) md5sum
Explanation: The md5sum command in UNIX is used to calculate and display an MD5 checksum for a file.
46. What is the purpose of the -c option in the md5sum command?
a) To check the checksum of a file
b) To create a new checksum file
c) To compare two checksum files
d) To display the checksum in a different format
Answer: b) To create a new checksum file
Explanation: The -c option in the md5sum command is used to create a new checksum file containing checksums for the specified files.
47. Which command in UNIX is used to verify the integrity of a tar archive?
a) verify
b) tar -v
c) tar -t
d) tar -x
Answer: c) tar -t
Explanation: The tar -t command is used to list the contents of a tar archive, allowing users to verify its integrity.
48. What is the purpose of the -W option in the tar command?
a) To exclude specific files or directories
b) To append files to an existing archive
c) To specify a different working directory
d) To preserve file permissions and ownership
Answer: a) To exclude specific files or directories
Explanation: The -W option in the tar command is used to exclude specific files or directories from the archive.
49. Which command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm?
a) gzip
b) compress
c) zip
d) tar -c | gzip
Answer: c) zip
Explanation: The zip command in UNIX is used to create a compressed archive of a directory using the zip compression algorithm.
50. What is the purpose of the -r option in the zip command?
a) To specify the compression level
b) To remove the original file after compression
c) To recursively compress files in subdirectories
d) To restrict access to the compressed file
Answer: c) To recursively compress files in subdirectories
Explanation: The -r option in the zip command is used to recursively compress files in subdirectories.