0

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
2

Via

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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