How to find files with filenames that are too long
Here’s a neat regular expression trick that you can use to find pathnames longer than a certain length, say, 20 characters:
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,}$'