Could use a bit of help guys.
I need to produce a report for the oldest and newest files that are residing in each unix directory
The structure is simple
Main folder with multiple subfolders that contains multiple files in each subfolder.
Folder
-Subfolders
--files
The below should output to txt file with following formatting.
SUBFOLDER_X
OLDEST:Date:filename
NEWEST:Date:filename
SUBFOLDER_Y
OLDEST:Date:filename
NEWEST:Date:filename
and so on...
I played with the below but stuck on getting it into shape of a report.
find . -maxdepth 1 -type f | cut -c3- |xargs ls -t | head -1
Any Help would be much appreciated.
Thanks