how to copy between current directory to another directory eg. i am trying to copy my current directory i.e Desktop to var/www/html

cp form.html ./var/www/html 

receive a following error

cp: cannot create regular file ‘./var/www.html’: No such file or directory


cp form.html /var/www/html

The dot means, relative to your current folder and you need an absolute path.

If form.html isn't a file but a folder, you should add the -r switch to copy recursively.

cp -r form.html /var/www/html

More about the cp command with man cp in a terminal or here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.