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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-25-2008
prsshini prsshini is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 20
Hi frank, one more help please,
I do below to list my files in chronological order.
ls -ltr *.datx* | tr -s ' ' | cut -d' ' -f9

it gives me list of files like below.

lock_eicu_20081120_00000000.datx_20081120_05315400
lock_eicu_20081118_00000000.datx_20081118_06303100
lock_eicu_20081111_00000001.datx_20081111_15531300
lock_eicu_20081111_00000000.datx_20081111_06335300
lock_eicu_20081030_00000000.datx_20081030_05342900
lock_eicu_20081016_00001111.datx_20081016_15525600
lock_eicu_20081016_00000000.datx_20081016_06350500
lock_eicu_20081001_00000000.datx_20081001_05344100
lock_eicu_20080912_00000000.datx_20080912_05305200
lock_eicu_20080904_00000000.datx_20080904_05335500
lock_eicu_20080822_00000000.datx_20080822_05344200
lock_eicu_20080812_00000000.datx_20080812_06331200
lock_eicu_20080808_00000000.datx_20080808_05345200
lock_eicu_20080806_00000000.datx_20080806_06343800
lock_eicu_20080802_00000000.datx_20080804_05332000
lock_eicu_20080718_00000000.datx_20080718_06533100
lock_eicu_20080606_00000000.datx_20080606_05340600
lock_eicu_20080603_00000000.datx_20080603_06345300
lock_eicu_20080531_00000000.datx_20080602_05304300
lock_eicu_20080529_00000000.datx_20080529_06330500
lock_eicu_20080501_00000000.datx_20080501_05343900
lock_eicu_20080429_00000000.datx_20080429_06311200
lock_eicu_20071228_00000000.datx_20071228_05343100

how do i sort the files again chronologically as per the date found just after .datx?
i mean in the list if u see "lock_eicu_20071228_00000000.datx_20071228_05343100" is the oldest file as it has date 20071228 after datx. so i need to list this file first and then sort so on.

Please help. Thanks again