In CPIO, which flag is used to copy files from one directory tree to another without using an archive?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The flag used with CPIO to copy files from one directory tree to another without creating an archive is the -p flag. This mode is specifically designed for "pass-through" operations, meaning it allows you to copy files directly from a source directory to a destination directory while preserving their permissions and other metadata.

When using CPIO in this pass-through mode, the user typically provides a list of files or directories to the command through standard input, and CPIO processes these paths, copying them to the specified location. This is particularly useful for maintaining the directory structure and file attributes, as CPIO handles the necessary copying operations efficiently.

This functionality stands out compared to the other options available in CPIO. The -o flag is used for creating an archive, while the -i flag is for extracting files from an archive. The -r flag is generally not associated with the core functionality of CPIO. Therefore, the -p flag is the appropriate choice for the described task of copying files directly without archiving them.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy