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
list the files but exclude the files in subdirectories shyjuezy UNIX for Dummies Questions & Answers 2 05-16-2008 07:22 AM
Sorting Files according to their Extensions... marconi Shell Programming and Scripting 1 12-07-2007 11:47 AM
list files alisevA3 UNIX for Dummies Questions & Answers 2 03-20-2007 10:40 PM
Find files with 3 different extensions mahalakshmi Shell Programming and Scripting 11 12-28-2006 02:19 AM
Command to select files with different extensions MobileUser UNIX for Dummies Questions & Answers 1 05-01-2006 11:20 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-24-2006
Registered User
 

Join Date: May 2006
Posts: 2
List Files by Extensions

I have a unix directory with 500 plus files . When I do a ls -lR I can see ALL the files here . How can I sort this by the files extensions ?

I can't enter ls -lR *.ext1 *.ext2 *.ext3 etc in case I miss out some files .
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-25-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 363
use sort

Specify delimiter for sort as period(.) and sort based on the second key.
Code:
ls -lR | sort -t. -k 2

This assumes your filenames donot have any period(.) inbetween their names.
Reply With Quote
  #3 (permalink)  
Old 05-25-2006
Registered User
 

Join Date: May 2006
Posts: 2
Yes ! It works now . Have sorted those 500+ files by extensions

Thanks
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:12 PM.


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

Content Relevant URLs by vBSEO 3.2.0