From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 1 Deploy, Configure, and Manage (2021)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Archive files using tar

Archive files using tar

- We often have to archive files and directories for backup purposes. With other operating systems, such as Windows, we might use zip for this. In Linux we use an archiver to preserve metadata such as ownership, permissions, access control lists, as well as the file data itself. The tool we usually use is "tar" or tape archiver. Tar itself doesn't compress files, but leaves that job up to compression tools. To demonstrate, we're going to create an archive of the slash Etsy directory. Because we're archiving a system directory, we'll need to elevate privileges with sudo. Type in sudo, space, tar, space, --xattrs. Xattrs preserves extended attributes, including access control lists and SELinux security context. Space -c to create an archive, v for verbose, p to save ownership and permissions, and then f for the file name of the archive. We're going to call it Etsy.tar. Space. And then the last argument is going…

Contents