mv - change case of windoze directory name

from noobie…

should be a (very) simple question…

I have a dir called ‘Linux’ in /windows/D/Nts, as in: /windows/D/Nts/Linux

I want to rename ‘Linux’ to ‘linux’ i.e. /windows/D/Nts/linux

using mv -vif /windows/D/Nts/Linux/* /windows/D/Nts/linux/
results in a series of msgs:
mv: /windows/D/Nts/Linux/foo.txt' and /windows/D/Nts/linux/foo.txt’ are the same file


ls l* results in:

ls: cannot access l*: No such file or directory

ls L* results in:

Linux:
listing all files therein.

what am I missing here? Is it because this is being done in a case insensitive Windoze directory? If so, how does one change the case of a Windoze directory name while running SUSE Linux?

Why the* /**? It is simply

mv windows/D/Nts/Linux windows/D/Nts/linux

to change the name of that one directory.

And it is not a windoze directory name, it is a directory name.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

IF it will work it’s never going to work at all when you have that
asterisk in there no matter which filesystem you try…

mv /windows/D/Nts/Linux /windows/D/Nts/linux

Good luck.

On 06/04/2010 12:46 PM, danperecky wrote:
>
> from noobie…
>
> should be a (very) simple question…
>
> I have a dir called ‘Linux’ in /windows/D/Nts, as in:
> /windows/D/Nts/Linux
>
> I want to rename ‘Linux’ to ‘linux’ i.e. /windows/D/Nts/linux
>
> using mv -vif /windows/D/Nts/Linux/* /windows/D/Nts/linux/
> results in a series of msgs:
> mv: /windows/D/Nts/Linux/foo.txt' and /windows/D/Nts/linux/foo.txt’
> are the same file
>
> ---------------------
> ls l* results in:
>
> ls: cannot access l*: No such file or directory
>
>
>
> ls L* results in:
>
> Linux:
> listing all files therein.
> ---------------------
>
> what am I missing here? Is it because this is being done in a case
> insensitive Windose directory? If so, how does one change the case of a
> Windose directory name while running SUSE Linux?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMCVH/AAoJEF+XTK08PnB5G7gQAKOlnEzHk3jmEH3MRKV45VQe
hZEYePJ3WhVXlUQWezqzifNAPx8++8n5xNOtlQS92rZGZwZrK9+f2nYhvbrO7WIP
1Em8EYgaKctFuVeaFUQqsVUpneVTG6dsfukbgWS/e/hEMoMlQd/N6/wKC4RS+kjK
KFxhClidnUVhaqdh7GDzPB+KFsH25KNDwAf+Y7kIOGKTsTWN7t5DGt5180qJmYDt
HzQomMwijop8OdHkI+vEd8GBjatrVG1kb9c1ZwF7LuzVZyt5Mz8EgCTopEy1UIL5
DDtrKHegased/iNmTZ4Nns2grern1qvNaoD37Cb7tX0TROAwVoZxbYQtDtxp890t
+atXG0a+/91i+mUhaE2wFCdSLBvFKpBHf+l5JQF9mhWJpJi9kj9IRtiSdYKTcLT7
67BmNFHP5VpEZY2J7HYxfFXz7c8FksB/T/hU+3L4A6WP4F5KnI4IqTQdOMmh6Eo6
m87tF67tqj5q9sHzR0IaYx0TlC/pkj9d9CS1pN54vMheEW0QeZ+MhlMViMypjeOZ
kcfWm50XscUMaAYsSY9MFXufHHglIQZtRGm+pFAZeK1stngdUNq9VEIA2uS8G16b
LU6re/0zFmq4WwN7x5SS/Hey8Cn7WjJTgQc6Lw8MC6/YetNgfdCZTPE+6SmhBXXi
cKqmH0oo4AJop2DuqXbD
=arkm
-----END PGP SIGNATURE-----

thank you for your quick replies…

this is what transpired:

mv /windows/D/Nts/Linux /windows/D/Nts/linux

resulted in this msg:
mv: cannot move /windows/D/Nts/Linux' to a subdirectory of itself, /windows/D/Nts/linux/Linux’

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

K, so there you go. The filesystem is not case-sensitive (case-aware is
the term I think) so try renaming it (truly renaming it) and then moving
it back with the new case as that MAY do the trick. Whether or not
windows sees the new case will be the ultimate question.

mv /windows/D/Nts/Linux /windows/D/Nts/linuxrename
mv /windows/D/Nts/linuxrename /windows/D/Nts/linux

Good luck.

On 06/04/2010 02:26 PM, danperecky wrote:
>
> thank you for your quick replies…
>
> this is what transpired:
>
> mv /windows/D/Nts/Linux /windows/D/Nts/linux
>
> resulted in this msg:
> mv: cannot move `/windows/D/Nts/Linux’ to a subdirectory of itself,

`/windows/D/Nts/linux/Linux’
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMCWI4AAoJEF+XTK08PnB5la8QALrd7AxNZFU/v46eHZDFwbFI
ivry8AnbVLVv/NDyDvebtyBxD0Rdyh+pAhJ5/XwYu+9mYClcITZLf2YCtPjGU3lr
MT00qJDcNbWuRRJxE3xaAsS6XO9xzorFNY3L7pY1nXeBNYLfQVXfD5UCzIDMQkO8
LEahhJjab90WXYt1HMP6s8RtG0TWk+9ToHFdqkZ0nXeT50m8e1fL7VLdtDwnEvi/
j128gPdjsJo+b6doD0X5VvGIFyjb4mUAUxdwZjdY4i49lrB4/Myn++/adJ/ktdkt
ihJBEOMBGNr/WsN3T6hhMX5sPiw9JAoJZxquryZfb4G1rv/Ah2NMdvQSu1e6J8uQ
f3VjC2SHovvbNhQqrLfQml8R551pZzc5M49ul9wj3GQauXUZvZJ21K1H48bOo0wY
59xd72K6FryK3xpd12h9d3eKc5sukyUtRAbtGRluOcghcdSXAzBRCQ/uX2OYFNl2
fb0H1IvqTxOqqPcAJ6apOjjU+wcrxcO+gW9AqX57i5HsEsavfqceIm0JDjHmfHA8
lq/NOVsGVCBOgxf3XOKr+idRc6nh42ZS6PcMRvPzKemwZE7PficAp8zqm7mfPHdn
kkGwXi3DE61Tjen1Dexf43b6LZkSJeeQbjY4v12qWJoHo+BnK2i3m3pgjfCZERlO
s4zaGWsDlq/fYDmJjNEv
=e7at
-----END PGP SIGNATURE-----

Thank you for your reply… Yea…that would probably work. I kind of had in mind a one-command solution. Maybe I’m not using mv correctly? Maybe there’s a more appropriate command to use?

Side-concern/suggestion: if mv is the main tool used to rename files and dirs, and it turns out that this does not work in a NTFS or FAT file system when changing case but keeping the same name, maybe a blurb should be added in the man(ual) page text stating this(?) my 2cents (what do I know… I’ve just loaded SUSE about 2 wks ago).

danperecky wrote:
> thank you for your quick replies…
>
> this is what transpired:
>
> mv /windows/D/Nts/Linux /windows/D/Nts/linux
>
> resulted in this msg:
> mv: cannot move `/windows/D/Nts/Linux’ to a subdirectory of itself,

`/windows/D/Nts/linux/Linux’

What about doing this:

cd /windows/D/Nts
mv Linux linux

Doing
mv /home/mkm/Changeme /home/mkm/changeme
works perfectly on my box…

…Kevin

Kevin Miller
Juneau, Alaska
http://www.alaska.net/~atftb
In a recent poll, seven out of ten hard drives preferred Linux.

thnks…no :frowning: same thing…

/windows/D/Nts> mv Linux linux
mv: cannot move Linux' to a subdirectory of itself, linux/Linux’
/windows/D/Nts> sudo mv Linux linux
mv: cannot move Linux' to a subdirectory of itself, linux/Linux’

Try ab’s last suggestion above. It’s got to do with the case sensitivity of NTFS.

maybe it’s important to mention that according to Expert Partitioner, the windows partition is Win95 FAT32… could be a determining factor.

That also has problems with case. Do what ab suggests.

if mv is the only solution to date, then please read on:

Side-concern/suggestion1: if mv is the main tool used to rename files and dirs, and it turns out that this does not work in a NTFS or FAT file system when changing case but keeping the same name, maybe a blurb should be added in the man(ual) page text stating this(?)

Side-concern/suggestion2: mv behavior be changed so that what ab suggests happens under the covers - as required, for Windose partitions.

I hope that some text above in this post is useful to someone.

my 2cents (what do I know… I’ve just loaded SUSE about 2 wks ago). :expressionless:

You have to understand why it misbehaves that way. When you move Name to name, it first checks that the destination doesn’t exist. However according to Windows rules, Name is the same file as name, and in fact NaMe is also the same file. So it decides that you want to move the directory into another directory. Oops no, it’s the same directory and you can’t move a directory into itself.

So because it can’t tell the difference between when a rename is needed instead of a move, as it would be able to do under sane filesystem rules, really a different command is needed, maybe it should be called

look-i-really-want-a-rename-you-stupid-filesystem Name name

Those who have designed mv (40 years ago) have only token real Unix (and by heritag Linux) file systems in mind. Never forget when using non Linux file systems on Linux that that software only can try to emulate things as if it is a sound Linux file system.

It is nice that we have an interface to FAT, VFAT, NTFS and their brothers, but try to use them only for a minimum of tasks. Simple exchanging of data with an MS sytem (dual boot or USB sticks) is OK to have, but for all others things use native Linux file systems.

On 2010-06-05, ken yap <ken_yap@no-mx.forums.opensuse.org> wrote:
>
> You have to understand why it misbehaves that way. When you move Name to
> name, it first checks that the destination doesn’t exist. However
> according to Windows rules, Name is the same file as name, and in fact
> NaMe is also the same file. So it decides that you want to move the
> directory into another directory. Oops no, it’s the same directory and
> you can’t move a directory into itself.

That is exactly why it won’t work, spot on.

I just wanted to add - for the OP - that renaming the case of a file/dir
doens’t allways work in Windows, neighter. Often, I’ve had to rename to a
temp name before putting the original name back with different case.


Any time things appear to be going better, you have overlooked
something.

as others have mentioned, the file system you are using is for
game/non-enterprise ready machines and should not be used for real data…

so the best solution is to put all your important stuff on a Linux
file system and you can have all these files in the same directory:

linux
Linux
LInux
LINux
LINUx
LINUX
lINUX
liNUX
linUX
linuX
lInux
liNux
linUx
and more (maybe)


DenverD (Linux Counter 282315)
CAVEAT: http://is.gd/bpoMD
posted via NNTP w/TBird 2.0.0.23 | KDE 3.5.7 | openSUSE 10.3
2.6.22.19-0.4-default SMP i686
AMD Athlon 1 GB RAM | GeForce FX 5500 | ASRock K8Upgrade-760GX |
CMedia 9761 AC’97 Audio