Which statement about cp and ACL rules is true?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which statement about cp and ACL rules is true?

Explanation:
ACLs add permission details beyond the basic read/write/execute bits. When you copy a file with cp, it brings over the data and the basic metadata (permissions, ownership, and timestamps), but it does not carry the Access Control List entries unless you explicitly tell it to. So, if you copy a file with plain cp, the destination ends up with the standard permissions and without the ACL rules from the source. To preserve ACLs, you have to use an option that asks cp to keep those extra attributes, such as cp -a (archive, which preserves ACLs and extended attributes) or cp --preserve=acl (plus any other attributes you want). Verifying with getfacl on the source and destination will show that the ACL entries are absent in the default copy unless preservation is requested. This is why the statement about cp not preserving ACL rules by default is the correct one. For context, mv can preserve ACLs in the same filesystem because it’s effectively a rename, but across filesystems it may involve a copy as well, so relying on mv for ACL preservation isn’t as consistent as using cp with the right preservation options.

ACLs add permission details beyond the basic read/write/execute bits. When you copy a file with cp, it brings over the data and the basic metadata (permissions, ownership, and timestamps), but it does not carry the Access Control List entries unless you explicitly tell it to. So, if you copy a file with plain cp, the destination ends up with the standard permissions and without the ACL rules from the source. To preserve ACLs, you have to use an option that asks cp to keep those extra attributes, such as cp -a (archive, which preserves ACLs and extended attributes) or cp --preserve=acl (plus any other attributes you want). Verifying with getfacl on the source and destination will show that the ACL entries are absent in the default copy unless preservation is requested. This is why the statement about cp not preserving ACL rules by default is the correct one. For context, mv can preserve ACLs in the same filesystem because it’s effectively a rename, but across filesystems it may involve a copy as well, so relying on mv for ACL preservation isn’t as consistent as using cp with the right preservation options.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy