Issues with mv on windows xp bash shell

1

As I'm pretty used to the Linux terminal, I set up a bash shell on my Windows XP command prompt by following the instructions in this article:

http://www.techsutram.com/2009/05/bash-environment-on-windows-this-is-not.html

I particularly wanted to settle for something light and compact and I get the impression that Cygwin is a pretty large distribution which I wanted to avoid.

It works really well for the most part but when trying to move a directory like this:

mv directory/another_directory .

I get:

mv: can't open directory/another_directory

I realise that this could be a distribution specific issue but if anyone has come across something similar could you please help?

It's odd because I have no problems renaming directories or moving files. Only when trying to move a directory.

Many thanks!

Nobilis

Posted 2012-12-21T11:41:12.063

Reputation: 175

what happens when you cd to the sub_dir and try mving it that way? – mcalex – 2012-12-21T11:51:52.857

I've downloaded a newer version of 'mv' and this seems to have fixed it, as the older one is dated at 1997, I assume it's a compatibility issue. Not sure what's going on underneath :)

With the older one, moving the directory from its parent directory didn't work either. – Nobilis – 2012-12-21T12:02:33.950

@Nobilis Isn't a mv syntax like this: mv -t target_dir source_dir ? – mnmnc – 2012-12-21T12:07:13.497

mv version from 1997? O_o i'm surprised it worked at all. – mnmnc – 2012-12-21T12:10:42.950

@mnmnc You can use the syntax above for moving directories too, I guess the -t option has been added so that the user is certain the files will be moved, not renamed. -t isn't a possible option for this 'mv' util under Windows though.

The online man page for mv has the following for it:

mv [OPTION]... [-T] SOURCE DEST mv [OPTION]... SOURCE... DIRECTORY mv [OPTION]... -t DIRECTORY SOURCE... – Nobilis – 2012-12-21T12:12:23.280

@mnmnc that is the syntax used (except for the optional -t). Notice the terminating dot? – mcalex – 2012-12-21T13:16:22.493

Answers

0

I fixed this problem by replacing the 'mv' application (dated at 1997) with a newer one (dated at 2001) located in the Unix utils pack discussed in the link.

Perhaps it was a compatibility issue with the newer version intended to address incompatibilities related to Windows XP (as they seem to have come out in the same year).

Nobilis

Posted 2012-12-21T11:41:12.063

Reputation: 175