File Listing, with a Twist?

Greetings!

I have a quick question which must be deferred to those with greater skill than myself :slight_smile:

In this situation, I wish to create a list of all the files on an entire partition in descending order sorted by date. I tried numerous switches for ls, and found this line to be the closest approximation to what I'm looking for:

ls -oadtR --color=never $PWD/* ./*

There are a couple of problems with the output, however:

  • The files so listed are sub-grouped within folders/directories.
  • The listings themselves contain extraneous information which includes permissions, owner, file size, etc.

In short, I simply need the modification date/time and the full path to every file listed in turn only; not grouped by directory or anything else.

Seemed to be simple enough at first blush; but here I am...

Any ideas/thoughts???

Thank you so much!

How far would

find . -printf "%T@ %p\n" | sort -r

get you?

2 Likes

Thank you for that, RudiC. Much closer...

Any chance of converting those timestamps in to human-readable dates/times???

Thanks again!

Try

find . -printf "%T@ %Tc %p\n" | sort -r | cut -d" " -f2-
2 Likes

Thank you again, RudiC! That'll hunt :wink:

Moderator comments were removed during original forum migration.