Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to find all files with some uppercase-only word

I follow this code convention to set constants in uppercase. However, since code grows big, it starts to go messy with all these constants around. Since regex is good for many purposes (except marked-up patterns :-P), I think it is suitable for our case. I am very bad at this alien language. Therefore, I call for the help of better fellows than myself.

TL;DR: given folder_route, find all filename words with ONLY uppercase characters.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Like this:

find folder_route/ -type f -regextype grep -regex '^\./[A-Z]\+$'

If you need to add - and _:

'^\./[A-Z_-]\+$'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading