File Sorting by file name

Hello,

I need to sort unix files by name i.e based on datetime. Can you please guide how to sort the files

file name format like ddmmyyhhmiss.csv

300907160001.csv
290608160001.csv
281007160001.csv
270507160001.csv
040508160001.csv

Thanks in advance

Parijat

Like with ls?

ls -lt --> newest to oldest
ls -ltr --> oldest to newest

Thank you for your reply, but it will not work for my case. I don't want files to be sorted base on the file creation date. File name itself a date.

300907160001.csv
290608160001.csv
281007160001.csv
270507160001.csv
040508160001.csv

This example works from a file, but you should be able to modify to accomodate your request.

> cat file77
300907160001.csv
290608160001.csv
281007160001.csv
270507160001.csv
040508160001.csv
> sort file77 -k 1.5,1.6 -k 1.3,1.4 -k 1.1,1.2
270507160001.csv
300907160001.csv
281007160001.csv
040508160001.csv
290608160001.csv

How about ls -lr:

300907160001.csv
290608160001.csv
281007170001.csv
281007160001.csv
270507160001.csv
060508160001.csv
040508160001.csv

I added a few more filenames and it seems to sort like you want.