The -a (archive) option is defined as the shorthand for -dR --preserve=all. That means it:
Recurses through directories (the same effect as -R).
Copies symbolic links as links rather than the files they point to (-d / --no-dereference).
Preserves every attribute that cp can, including mode, ownership, timestamps, extended attributes and SELinux contexts ( --preserve=all ).
None of the other command lines meet every requirement:
-r alone is only recursive; it does not preserve ownership, permissions or contexts.
-Rpv is recursive and preserves mode/ownership/timestamps, but -p does not include SELinux contexts, and -R without -d will still copy links correctly yet lacks the context preservation the question demands.
-Lra forces dereferencing of symbolic links because of -L, so links would become regular files, violating the requirement.
Therefore the only command that fulfils every condition is the one that uses cp -a.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the '-a' option in the 'cp' command do?
Open an interactive chat with Bash
Why does the '-L' option cause symbolic links to be dereferenced?
Open an interactive chat with Bash
What attributes are included in '--preserve=all', and why are they important?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access