-1

On , I have the following directory structure:

/var/www/html

I am in www and I decided to move a file from this directory to html. I executed the following:

mv myfile.iso /html

Now I cannot see the file. Apparently I did not use the command properly. Any help to recover the file?

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Kamil
  • 968
  • 1
  • 8
  • 18

2 Answers2

1

When u need to move a file you need to do this like: "mv foo ~/Desktop", You forgot the ~ sign. What mv does is also rename the file.

The mv command will move a file to a different location or will rename a file. Examples are as follows: "mv file foo" will rename the file "file" to "foo". "mv foo ~/Desktop" will move the file "foo" to your Desktop directory, but it will not rename it. You must specify a new file name to rename a file.

You should look if u can find a folder called html in the root.

Almira
  • 31
  • 3
1

Yeah, your file is either now called html, and it stands in the root directory / (I'm not even sure this is possible), or it moved to existing directory /html

You must do the following to find it back (second case I spoke of):

mv /html/myfile.iso /var/www/html

or if it doesn't work (first case):

mv /html /var/www/html/myfile.iso 
J. Chomel
  • 8,193
  • 15
  • 41
  • 69
  • 1
    The file has been moved to `/` and got renamed to `html`. `mv /html /var/www/html/myfile.iso` is the solution. Thanks! – Kamil Apr 29 '16 at 11:42