Problem with cp command ..... pls help

hi, my name is prashanth. currently taking LFCS course
i have a problem with cp command

bob@ubuntu-host ~ ➜ cp -r /home/bob/lfcs/ old-data-3

bob@ubuntu-host ~ ➜ ls old-data-3/
data1 data2 data3 lfcs.txt

bob@ubuntu-host ~ ➜ cp -r /home/bob/lfcs/ old-data-3

bob@ubuntu-host ~ ➜ ls old-data-3/
data1 data2 data3 lfcs lfcs.txt

i am trying to copy the “lfcs” folder into “old-data-3” folder
but it is copying only the contents of “lfcs” folder
when i run the same command for the second time it copies the “lfcs” folder in to “old-data-3”
can someone pls explain ?

Hi @prashanth90

This SO answer should help.
If you want to copy the source directory to the target, do not add the / trailing slash to your source.

“If you want to copy the source directory to the target, do not add the / trailing slash to your source.” - inaccurate and incomplete. See my reply here