4
2
In my folder I got files like
/data/filename.log /data/filename.log.1 /data/filename.log.2 /data/filenamefilenamefilename.log /data/filenamefilenamefilename.log.2
I wish to use "find" command to list out files where length is greater than 15 characters.
I have tried the following, but none of them work:
find ./ -type f -iregex "/^.*{15,1000}$/" -print
find ./ -type f -iregex "/^.*{15}$/" -print
find ./ -type f -iregex "^.*{15}$" -print
find ./ -type f -iregex ".*{15}" -print
find ./ -type f -iregex ".{15}" -print
find ./ -type f -iregex ".{15,1000}" -print
Not sure what is the correct way?
Thanks!
Actually it isn't clear whether you want the filename to be greater, or the entire path? – Paul – 2012-04-11T12:45:35.497
Thanks paul for the prompt reply and valuable feedback. I just want the filename..thanks :) – forestclown – 2012-04-12T01:41:38.420
Great. Then my approach is far simpler - it is just matching on filename. – Paul – 2012-04-12T01:51:44.707
This approach worked for me and is much simpler than defining regexptype, etc. Thanks! – Jesper Rønn-Jensen – 2013-06-19T11:31:21.543