I have on my Linux NAS miscellaneous folders with identical names, except for case,like this:
- /data/libraries
- /Data/libraries/presets
- /Data/Libraries/presets
- /Data/Libraries/Presets
- /merged/readme
- /merged/Readme
- /merged/ReadMe
- /merged/README
- etc.
This is ok-ish on Linux, even though not desirable, but because this is on a NAS that services Windows PCs, the client PCs get confused and only actually show the content of one of the folders, despite showing all the variations...
There are so many, that I want to automate merging these folders together.
What capitalization we end up with is really irrelevant, although a format of 'Capitalized First Letter Of Each Word' would be preferred, if remotely possible, the ultimate goal is to just have one of each folder name.
(NOTE: I am aware that there may be conflicts in the file names contained in these folders as well, but after discussing, I'm willing to take the risk that there might be identically named files with different content, simply because currently a lot of the content isn't even readily accessible anyway!)
Are there any ready-made CLI tools (or BASH scripts) to do this?
casesensitivity=insensitiveto avoid problems caused by lazy windows developers who don't use consistent capitalisation for file/dir names.....and symlinks for the dumb ones that make both "Electronic Arts" and mis-spelled "Electrontic Arts" folders).mkfs -t ext4 -O casefold ..., and restore. Then you can selectively enable case-insensitivity on directories withchattr +F.md5sumto compare the files. I'd recommend NOT just overwriting any conflicting files but renaming them to .bak or .1, .2, .3, etc. Turn the other directories into symlinks (or, better yet, convert the fs to enable case-insensitivity).find . -type d | sort -f | uniq -Di | wc -l, and the answer is 1208... A little too much to do manually, esp. on a headless CLI only system.