System Management

An administrator must archive the /home/user1 directory into a gzip-compressed tar file at /backup/user1.tar.gz. The member names must begin with user1/ so the archive can be extracted under any directory on another server. Which command does this?

Show the answer

Correct answerB. tar -czf /backup/user1.tar.gz -C /home user1

The -C option makes tar change to /home before reading user1, so members are stored as user1/... and can be extracted anywhere. Naming /home/user1 directly creates the archive but stores the members as home/user1/..., which would recreate the extra home directory level on extraction.