What are other cp options?

0185

In addition to the common options previously mentioned, here are some other cp options you might find useful:

Additional cp Options:

  • -n or --no-clobber: Do not overwrite an existing file; skip copying if the destination file exists.
  • -p or --preserve: Preserve file attributes such as mode, ownership, and timestamps.
  • --parents: Copy files while preserving the directory structure leading to the source file.
  • --sparse: When copying, create a sparse file if the source file is sparse (i.e., contains long sequences of zero bytes).
  • --help: Display help information about the cp command and its options.
  • --version: Show the version information of the cp command.

Example Usage:

cp -n source_file.txt destination_file.txt

This command will copy source_file.txt to destination_file.txt only if destination_file.txt does not already exist.

If you have any further questions or need more details, feel free to ask!

0 Comments

no data
Be the first to share your comment!