Skip to main content
extended solution
Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)


To sort in descending order:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort -k1,1r | cut -d' ' -f2 

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)


To sort in descending order:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort -k1,1r | cut -d' ' -f2 
added 3 characters in body
Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is secondsseconds since Jan. 1, 1970, 00:00 GMT,Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)`

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)`

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)

Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

get file names only ... sorted by modification day

find + sort + cut approach:

find . -regex ".*/[0-9.]+" -printf "%T@ %f\n" | sort | cut -d' ' -f2 

  • %T@ - File's last modification time, where @ is seconds since Jan. 1, 1970, 00:00 GMT, with fractional part

  • %f - File's name with any leading directories removed (only the last element)`