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
script needed for listing files jayaramanit Shell Programming and Scripting 2 09-10-2007 08:17 AM
Listing Files krishna_sicsr High Level Programming 3 04-05-2007 02:32 PM
Listing of files Vitalka Linux 1 03-02-2005 09:32 AM
help - listing files richarmj Filesystems, Disks and Memory 2 10-02-2003 10:14 AM
Recursive directory listing without listing files psingh UNIX for Dummies Questions & Answers 4 05-10-2002 11:52 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2007
coolbhai coolbhai is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 30
Question Help needed in Listing Files

I need to list files in alphabetical-group and each such group listed in increasing order of timestamp.

Example : If I list files in a directory ( ls -lrt ) it shows like below.

c3
b4
b3
a4
a3
c2
b2
c1
b1
a2
a1

What I need is

c3
c2
c1
b4
b3
b2
b1
a4
a3
a2
a1

How can this be achieved using a command. ? Please help ?
  #2 (permalink)  
Old 10-03-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,777
try this:
Code:
for prefix in c b a
do
     ls -lrt "$prefix"*
done
  #3 (permalink)  
Old 10-03-2007
coolbhai coolbhai is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 30
Thank you ,That worked, Actually I was looking for a single line code.
  #4 (permalink)  
Old 10-03-2007
rein rein is offline
Registered User
  
 

Join Date: Dec 2004
Location: Zürich
Posts: 146
ls | sort -n ???
  #5 (permalink)  
Old 10-03-2007
coolbhai coolbhai is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 30
Quote:
Originally Posted by rein View Post
ls | sort -n ???
It will sort in groups, not in timestamps..
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 04:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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