[mdlug] How to find file name length?

Paul set at pobox.com
Wed Sep 26 02:35:51 EDT 2007


Stan Green <Stan at mcomputersolutions.com>, on Tue Sep 25, 2007 [10:35:51 PM] said:
> I was trying to burn a DVD using K3b. I have about 4.3GB of data in thousands 
> of files. This disc needs to be shared between Linux and Windows. Because of 
> this I am using 103 character Joliet extensions. I don't get vary far because 
> K3b throws an error on files with names longer than 103 characters. The 
> problem is it does not tell me what file has a name 103 characters. 
> 
> So the question is: Is there a way to find all files with a name length of 
> greater than 103 character?
> 
> Thanks,
> Stan Green
> 
	Hi;

	Can you get better results using UDF? -- windows should grok that
fine.

	Well, this is almost perverse (and probably slow), but
this invokation will tell you all the files greater than 99
characters long (in theory):

#>  find / -type f -exec bash -c 'echo "$(basename "{}" | wc -c) {}" ' \;
	| egrep '^1[0-9]{2}'

Paul
set at pobox.com

ps. If I was really doing this, I would have find -exec a separate more
sophisticated script or program, but I wanted to get it all on one command line.
Im sure there are more better ways to do this, but Im not highly invested
in getting there;)




More information about the mdlug mailing list