Skip to main content

Which cp are you using? UNIX tools are sort of similar among different systems, but may behave differently in some situations.

GNU cp has the behavior you want. BSD cp has the behavior you describe. Try appending aremoving the slash tofrom the first argument, and writing:

cp -R /parentFolder/folder2 /parentFolder/folder1/folder1.1

rather than:

cp -R /parentFolder/folder2/ /parentFolder/folder1/folder1.1

According to wikipedia(1), this is how BSD cp does what you want.

Which cp are you using? UNIX tools are sort of similar among different systems, but may behave differently in some situations.

GNU cp has the behavior you want. BSD cp has the behavior you describe. Try appending a slash to the first argument:

cp -R /parentFolder/folder2/ /parentFolder/folder1/folder1.1

According to wikipedia(1), this is how BSD cp does what you want.

Which cp are you using? UNIX tools are sort of similar among different systems, but may behave differently in some situations.

GNU cp has the behavior you want. BSD cp has the behavior you describe. Try removing the slash from the first argument, and writing:

cp -R /parentFolder/folder2 /parentFolder/folder1/folder1.1

rather than:

cp -R /parentFolder/folder2/ /parentFolder/folder1/folder1.1

According to wikipedia(1), this is how BSD cp does what you want.

Source Link
njsg
  • 13.8k
  • 1
  • 29
  • 29

Which cp are you using? UNIX tools are sort of similar among different systems, but may behave differently in some situations.

GNU cp has the behavior you want. BSD cp has the behavior you describe. Try appending a slash to the first argument:

cp -R /parentFolder/folder2/ /parentFolder/folder1/folder1.1

According to wikipedia(1), this is how BSD cp does what you want.