LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Length of filenames (https://www.linuxquestions.org/questions/linux-newbie-8/length-of-filenames-178735/)

supreme_command 05-06-2004 07:16 PM

Length of filenames
 
Hey
I want to know how to be able to search through a directory and print out just the file that has the longest filename. Like i am writing scripts for it

If anyone just knows a way to find the length of a filename i would be happy

Thanks

Technoslave 05-06-2004 09:15 PM

Because I'm lazy, here's a start for this:

for i in `ls`;do echo $i |wc -c;done

I leave it to the poster to figure out the eval statements and what not.


All times are GMT -5. The time now is 05:27 AM.