What if -r is not used?

QuestionsQuestions8 SkillsProBasic Files OperationsOct, 05 2025
0107

If the -r option is not used when attempting to copy a directory, the command will typically fail with an error message indicating that the target is a directory. For example, using cp without -r will not allow you to copy a directory and its contents, as the command expects a file rather than a directory.

For instance:

cp source_directory destination_directory

This command would result in an error like:

cp: omitting directory 'source_directory'

In summary, without the -r option, you cannot copy directories; you can only copy individual files.

0 Comments

no data
Be the first to share your comment!