The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Lowercase to Uppercase ggovotsis AIX 7 10-16-2008 07:07 AM
Need to change filenames in a particular directory from lowercase to UPPERCASE Duke_Lukem UNIX for Dummies Questions & Answers 7 01-07-2008 03:32 PM
replacing all 4 first upper char of every rec to lowercase ? Browser_ice UNIX for Dummies Questions & Answers 2 08-02-2006 09:06 AM
How convert lowercase or uppercase Alex20 Shell Programming and Scripting 5 03-07-2005 04:07 AM
uppercase to lowercase webex Shell Programming and Scripting 4 01-03-2002 11:15 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-23-2002
Registered User
 

Join Date: Feb 2001
Location: San Francisco
Posts: 30
find lowercase filenames

How do I write the command to find all files with any lower case letters in the filename? I have tried
find . -name *\(a-z\) and a lot of combinations like that, without success.

thanks
JP
Forum Sponsor
  #2  
Old 01-23-2002
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
To find all files that have a lowercase letter anywhere in the filename:

ls | egrep [a-z]
  #3  
Old 01-23-2002
Registered User
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
That'll give you them files with lowercase letters somewhere in the filename for the current directory only.

To scan subdirectories...navigate to the higest point for the search then use

ls -lR | egrep [a-z]

This will recurse through all subdirectories below that point.
__________________
Pete
  #4  
Old 01-24-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
That will match all filenames, since you're using ls -lR... since it's now a long listing there will always be a lowercase letter in there somewhere (like the permissions...).

Try find /dir -name "*[a-z]*"

I think that should do it...
  #5  
Old 01-28-2002
Registered User
 

Join Date: Feb 2001
Location: San Francisco
Posts: 30
thanks everyone, for the easy way. if you would like a more complicated method, try this:

ls|egrep [a-z]|cut -d : -f2 > list$$;cat list$$|xargs ls -l; rm list$$

JP
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0