I often do the command such as:
mv folder $something_that_does_not_exist
mv files* $something_that_does_not_exist
Then, I realise that my files are gone. I cannot see them even in the folder "$something_that_does_not_exist". Where have my files and folders gone? How can I get them back?
In order to prevent this problem, I have a habit of always appending a / to the end of directory names when using cp
or mv
:
$ touch foo
$ mv foo bar/
mv: cannot move `foo' to `bar/foo': No such file or directory
Without the trailing slash, mv
does a file rename operation. You may find that your file(s) have changed name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With