0
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.
2What is the output of alias mv? – MariusMatutiae – 2014-11-13T17:16:06.077
Oh f***. I feel shame. It's an alias of
ln -i
. I have to find out what is doing that alias. Thank you. At least I know where to start. – Dawid Ferenczy Rogožan – 2014-11-13T17:19:04.960OK, solved. It was my fault. When I was creating "secure" aliases for
cp
,mv
andln
withinteractive
argument I copy&pasted previous ones. And I have changed alias content but not alias name in case ofln
alias. So it wasmv='ln -i'
. – Dawid Ferenczy Rogožan – 2014-11-13T17:28:27.2631Always remember the
type
command: it's likewhich
, except that it also includes aliases, functions, etc. Likewhich
, there is also the-a
option to show every possible interpretation. – AFH – 2014-11-13T17:58:17.277Thank you. Actually I know it. But I didn't imagine that the cause could be on this level. I suspected something much more low-level, something on system level. Something like "system.filesystem.move_objects_this_way" or so :) – Dawid Ferenczy Rogožan – 2014-11-13T18:02:04.450