Monday, May 6, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 459  / 1 Year ago, fri, may 19, 2023, 7:44:35

I need to get a list of all the files that only differ in case.



I.e., if I have a folder (with sub-folders) with the files:



one.txt
ONE.txt
two.txt
three.txt
three.TXT
four.txt
five/5.txt
five/6.txt
five/6.Txt


I want some bash magic that will spit out:



one.txt
ONE.txt
three.txt
three.TXT
five/6.txt
five/6.Txt

More From » command-line

 Answers
7
ls -R | uniq -Di


should do it for you, supposing your locale sorts upper and lower case letters together. If your local is C, all bets are off.



export LC_ALL=C

[#29196] Friday, May 19, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trousransla

Total Points: 285
Total Questions: 112
Total Answers: 113

Location: Spain
Member since Thu, Dec 23, 2021
2 Years ago
;