I want to copy this folder:
cp -r /home/thej/public_html/JC/ajax /home/thej/public_html/demo/conf
I try to put a trailing
/ on the target.
If I make a mistake and the source and target are both files rather than directories, adding the
/ means that I'll get an error; without the
/ it will clobber the target file.
(Tab completion will usually add the trailing
/ anyway, so it's usually easier to add it than not.)
See Volker Siegel's answer for more details.