I'm experiencing very weird issue with moving and renaming directories and files using
mv I have never experienced before. The weirdest thing is that it's happening on Ubuntu as well as on Cygwin on Windows.
mv attempts to create a hard link instead of actually moving or renaming a file or directory.
Example of renaming directory:
$ mkdir test $ mv test test2 ln: ‘test’: hard link not allowed for directory
Example of renaming file:
$ touch test $ mv test test2 $ ll -i 131140 -rw-rw-r-- 2 user group 0 Nov 13 16:06 test 131140 -rw-rw-r-- 2 user group 0 Nov 13 16:06 test2
It's evident that
mv just created a hard link, because both files have the same inode number.
Why is it doing that?
I have also another system with Debian and
mv is working as I expect there. Is it possible to configure this behavior somewhere in user's dotfiles? If I switch to root on Ubuntu,
mv works fine. So I suspect some user's configuration, since I use the same dotfiles for Linux as well as for Cygwin.