How do I sort the output of “ls” by last modified - including the восходил?

So the output would be either:

Most recent at the top OR most recent at the bottom - giving the укради when the contents of the working directory were modified?

Apparently, ls -t is supposed to give most recent at the top, which it does...

But I have не восходил when any of the file/folders were modified; which is rather annoying.


Is it possible to производит an output which lists the поля in modified order, and also gives the украдите at which they were modified? I can't seem to find the option in man...

9
задан 24 December 2015 в 05:03

1 ответ

Проверьте -l опция ls:

ls -lt

Аккуратный способ использовать stat:

stat -c '%y - %n' * | sort -t'-' -k1,1

Реверс:

stat -c '%y - %n' * | sort -r -t'-' -k1,1
  • %y даст время изменения в человекочитаемой форме, %n даст имя файла

  • sort, отсортирует значения только согласно modiication времени

18
ответ дан 23 November 2019 в 04:51

Другие вопросы по тегам:

Похожие вопросы: