-1

I want to move a .php file named My Form.php which I have saved on my Desktop before to \var\www.

When I use: sudo mv My Form.php www in terminal, it says there is no such file My.php and Form.php.

2
  • try using ls to view files and pwd to view in which directory you're performing operation Commented Apr 21, 2015 at 9:10
  • \var\www is wrong in Unix/Linux. A correct path is /var/www.
    – A.B.
    Commented Apr 21, 2015 at 9:31

2 Answers 2

1

Open a terminal and run this commnd:

sudo mv ~/Desktop/My\ Form.php /var/www

Here's what you did wrong:

I use: sudo mv My Form.php www in terminal

  • sudo mv My Form.php

    mv interprets there are two files: My and Form.php, therefore, the backslash before the space. Also double quotes can be used (sudo mv "~/Desktop/My Form.php" /var/www).

  • www

    That doesn't help you at all; your target is /var/www

0
0

You need to put the filename inside "" doublequotes because your file has a space in his name and so it's seen as 2 separate file from the shell. You need either to issue sudo mv "My Form.php" /var/www or sudo mv My\ Form.php /var/www the backslash \ before the space is an escape character. Note that in Ubuntu (and -in general- under Linux) file path are described using / and not \

1
  • I'm assuming you are going to issue the command from the same folder "My Form.php" is in, otherwise you have to prefix the filename with the full path to the file .php
    – svalo
    Commented Apr 21, 2015 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .