Which tar option allows you to update an existing archive by adding new files?

Prepare for the LPI Linux Essentials Exam with our comprehensive quiz. Study with interactive flashcards and multiple choice questions, with detailed hints and explanations for each. Ace your exam with confidence!

The option that allows you to update an existing tar archive by adding new files is the -u option. This functionality is specifically designed for updating an archive, which means it lets you add only those files that are more recent than the files currently in the archive. Consequently, when the -u option is used, tar checks the timestamps of the files specified against those in the archive and only includes the newer files, which helps maintain an efficient backup process without duplicating older files that already exist in the archive.

The other options serve different purposes:

  • The -c option is for creating a new archive, which simply means it packages files and directories into a new tar file but does not update any existing archive.

  • The -x option is for extracting files from an existing tar archive, allowing you to retrieve data that has already been archived.

  • The -f option is used to specify the filename of the tar archive to be created, extracted, or updated. It is a part of the command syntax but does not directly relate to the updating function of the archive itself.

In summary, the -u option is the correct choice for updating an existing tar archive by adding new or modified files based on their timestamps.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy