A system administrator must copy the directory "/var/log" and all of its subdirectories from the local server to a remote host while ensuring that the original file permissions and timestamps are preserved. Which option combination should be used with scp to meet this requirement?
The -r option tells scp to copy directories recursively. The -p option preserves modification and access times as well as file modes (permissions). Using both flags together (-pr or -rp) therefore copies the complete directory tree while retaining the desired metadata. By contrast, -p alone would preserve metadata but would not recurse into subdirectories, -r alone would recurse but reset timestamps and permissions, and -P only specifies an alternate SSH port.
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 '-p' option in scp do?
Open an interactive chat with Bash
What happens if only the '-r' option is used with scp?