cp -r command error

When I use the cp -r command (in powershell) I either get an error message saying “x file already exists” if I supply existing files as values for the various parameters, but if I supply values that don’t exist, I get an error message that says “x file doesn’t exist.” Where do I go from here?

So remember that commands need arguments. The cp command needs a FROM and TO argument. You can’t just do:

cp -r

That kind of like if I write sentence like this:

"So I was going

Just trails off right there going nowhere. To fix it, you need to say from where to where:

cp -r sourcedir newdir

This will take a directory named sourcedir and do a deep copy of it into newdir.

1 Like