Answers for "ls sort by date"

1

python how to sort by date

from datetime import datetime
my_dates = ['5-Nov-18', '25-Mar-17', '1-Nov-18', '7-Mar-17']
my_dates.sort(key=lambda date: datetime.strptime(date, "%d-%b-%y"))
print(my_dates)
Posted by: Guest on September-01-2020
1

ls sort by date

ls -lt
Posted by: Guest on December-31-2020
0

linux sort by date modified

$ ls -lt
Posted by: Guest on January-08-2021
0

ls sort by date

ls -halt
Posted by: Guest on August-09-2021

Browse Popular Code Answers by Language