I ran the mv command to move two files, let's call them file_name_1, file_name_2. The command I used was:
mv file_name* /u/projects/lib
My assumption was that this would move both files into the lib directory. What ended up happening was that file_name_2 got moved correctly but file_name_1 was deleted from the directory I was moving it from and the directory I was moving it to.
Losing the file wasn't a big deal as I was able to recover the file from a backup and did not lose any work but I am curious as to why this would happen and what would be the best way to prevent it from happening again? (For now I'm just copying the files over and then deleting the source file once I am sure it copied over fine)
/u/projects/lib
. Sometime it helps to tryecho {command...}
first to see what file expansion does before running the command. Btw, your target directory name is unusual. Are you on native Ubuntu or is this WSL or else?