Question

This is probably a very stupid question, but is it possible that files can be deleted with the "mv" command? I'm asking because I when I was attempting to move a file up to its parent directory, I accidentally typed one "." too many and now I can't find my file.

So instead of:

$ mv myfile.txt ..

I had put:

$ mv myfile.txt ...

Now my file is gone. Did I delete it accidentally, and is it possible to get it back at all?

Thanks!

Was it helpful?

Solution

Your file has been renamed to "..." do an ls -a to see dot files.

Try mv ... ../myfile.txt to get do what you originally wanted.

OTHER TIPS

you file is now named as ..., check it with ls -al in your current dir.

On UNIX systems, file names starting with a dot are hidden from directory listings by default.

ls -lA

will display dot files.

You can rename the file back

mv ... myfile.txt

Your file is now called ... and is not visible thru the simple ls command.
Use ls -a to make "system" files (starting with a dot) visible or rename it back mv ... your_file.

And to answer the title-question:

Yes and no.

It' s not possible, but moving the file to /dev/null will delete it as well. :D

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top