I use the following command to copy a folder (named 'dist') containing a react project to my frontend folder:
cd apps/react-app
sudo cp -R dist ../server/frontend/client
The first time I run the 'cp'-command, the content of the 'dist'-folder gets copied into the 'client'-folder. I would expect that when I run this command again, the cp-command would overwrite the files in the 'client'-folder. This doesn't happen, instead, the 'cp'-command now creates a 'dist'-folder inside the 'client'-folder en puts all the new files in there. The 3th, 4th, ... time I run the 'cp'-command, it overwrites all the files in the 'dist'-folder, but the files from the first 'cp'-command are still in the 'client'-folder also.
How can I cp the files from the 'dist'-folder to the 'client'-folder, and whenever I run this command again, it overwrites (instead of creating a new folder)?
client
directory already exist before all of this? – DonHolgo Apr 27 '21 at 07:52