In Linux, which command is used to create a compressed archive of files using the 'gzip' format?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command used to create a compressed archive of files using the 'gzip' format is accurately represented by the option that includes the 'tar' command with the specific flags '-czf'. Here's why this choice stands out:

The 'tar' command is traditionally used for creating archives in Linux, and when combined with the '-c' flag, it indicates that a new archive is being created. The '-z' flag specifies that the archive should be compressed using 'gzip', and the '-f' flag allows you to specify the filename of the archive. This combination effectively packages the specified files into a single archive file and compresses it using the 'gzip' format.

The other options either do not utilize 'gzip' for compression or do not create the archive as intended. For instance, just using 'gzip -c' would compress a file but not create a tar archive. Similarly, 'tar -cvf' creates a tar archive but does not compress it using 'gzip'. The command 'zip -r' refers to a different compression tool altogether and does not utilize 'gzip'.

Therefore, the use of 'tar -czf' is essential for both archiving and compressing files using the 'gzip' format in one command.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy