I moved all files from one directory using mv
and accidentally made a typo in the target location path.
The system returned a message that the directory does not exists, but my files from source directory got erased.
Is that a bug? Should moving files to a nonexistent location erase the files being moved? (This is on Ubuntu 18.04.2 LTS.)
The specifics were:
- Created
test.txt
file. - Moved the file to
/ben
withsudo
. - The file disappeared.
/ben
does not exist.
The commands and output were:
ben.b@c-w46:~/Desktop/test-folder$ sudo mv test.txt /ben
ben.b@c-w46:~/Desktop/test-folder$ cd /ben
bash: cd: /ben: Not a directory