My old and new directory have same folders and files inside.
I try:
mv -if old/* new/*
and get error
mv: cannot move `./xxxxxx' to a subdirectory of itself
How can I move it?
You should use mv -if old/* new/
without the trailing *
.
This is because it unrolled to
mv -if old/foo old/bar old/baz new/foo new/bar new/baz
i.e. move everything into new/baz
This is not what you wanted.