Scenario
I have a NAS (Synology DS1813+ based on DSM 4.3). It runs a version of linux, so the file system is (supposedly) case sensitive. I access the NAS with 2 computers. One of them runs Windows 7 (case insensitive file system) and connects to the NAS via a network share. The other runs Linux Mint (case sensitive file system) and mounts the NAS with CIFS.
I connected a digital camera (Canon 7D) to the Windows computer and imported the images from the camera into the NAS via the network share. The images that are stored on the NAS have upper case extensions (IMG_8835.JPG).
Later, on the Linux machine, I tried to rename these images in bulk so the extensions would be lower case with the following commands and output:
$ find . -name '*.*' -exec sh -c 'a=$(echo {} | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "{}" ] && mv "{}" "$a" ' \;
mv: ‘./IMG_8835.JPG’ and ‘./IMG_8835.jpg’ are the same file
and:
$ rename s/.JPG/.jpg/ *.JPG
IMG_8835.JPG not renamed: IMG_8835.jpg already exists
This indicates that the file system is case insensitive. Correct?
Additionally, I tried:
$ rename -f s/.JPG/.jpg/ *.JPG
The output of this command was blank so I suspected it worked. But then when I reviewed the files, they still had the upper case extension. The files are not duplicated. There are not any files of the type *.jpg
. They are all still *.JPG
.
Questions
- Is there a command line (bash command) that will report the case sensitivity of both the local and remote file systems?
- It appears the file system is case insensitive. This perplexes me. How could that be? Both the remote file system on the NAS and the local file system on the box running Linux are (supposedly) case sensitive file systems.
- Is it possible that even though the NAS file system is (supposedly) case sensitive, since the folders and files were created on the NAS from Windows while the NAS was attached via a network share, that the Windows created files and folders are case insensitive? If so, can the case sensitivity of the windows created objects be modified when connected to the NAS from a Linux box?
NOTE: This question is not a duplicate of this question because this question is asking about the case sensitivity of the file system rather than how to rename the files in bulk.