The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-24-2006
newbienix newbienix is offline
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 .
  #2 (permalink)  
Old 05-25-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
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.
  #3 (permalink)  
Old 05-25-2006
newbienix newbienix is offline
Registered User
  
 

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

Thanks
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0