linux - cp command conflicts on non-existent files -


an error occurs when ran command on redhat server data directory:

rm -rf data; cp -r another_dir data 

an error occurs command:

cp: cannot create directory `data/test': file exists 

this error not happen. when see error can rerun commands , succeed. also, changing ; sign $ not solve problem.

i don't understand. how possible?

what data? directory or file ? if directory try rmdir data if file , try rm -f data

since rm -rf data;cp -r another_dir data 2 different commands . try 1 one , give me result


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -