LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-06-2004, 08:16 PM   #1
supreme_command
LQ Newbie
 
Registered: Feb 2004
Distribution: Mandrake
Posts: 7

Rep: Reputation: 0
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
 
Old 05-06-2004, 10:15 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password length ust Linux - Distributions 1 04-06-2005 06:18 AM
Shell scripting to find length of filenames ridertech Linux - Newbie 2 08-25-2004 01:07 PM
sound length mihman Linux - Software 0 08-21-2003 06:21 AM
Horizontal Length rch LQ Suggestions & Feedback 1 05-16-2003 04:21 AM
message length boku LQ Suggestions & Feedback 2 08-05-2002 12:57 PM


All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration