🤖🚫 AI-free content. This post is 100% written by a human, as is everything on my blog. Enjoy!

How to find files with filenames that are too long

February 19, 2014 in Software

Here’s a neat regular expression trick that you can use to find pathnames longer than a certain length, say, 20 characters:

find -E . -regex '.{20,}'

If you only need filenames that are too long (without the path), the regex is a bit more complicated:

find -E . -regex '.*[^/]{20,}$'

Buy me a coffee Liked the post? Treat me to a coffee