how to copy from current folder to another folder

6,063

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.

Share:
6,063

Related videos on Youtube

Aaditya
Author by

Aaditya

Updated on September 18, 2022

Comments

  • Aaditya
    Aaditya over 1 year

    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