I have a folder that has new files created everyday, is there a way i can filter them so that only the 5 newest files are displayed? I'm hoping this can be done by a one liner without a script.
for example my directory contains
-rw-r--r-- 1 root root 0 Jun 24 08:34 file112
-rw-r--r-- 1 root root 0 Jun 28 08:34 file12
-rw-r--r-- 1 root root 0 Jul 25 08:34 file1
-rw-r--r-- 1 root root 0 Jul 26 08:34 file2
-rw-r--r-- 1 root root 0 Jul 27 08:34 file3
-rw-r--r-- 1 root root 0 Jul 28 08:34 file4
-rw-r--r-- 1 root root 0 Aug 2 20:59 file200
I want to be able to be able to just list the 5 newest files.
As a alternative I guess I can filter them by time, is there a way to just show the file name without the ./ in front?
find -type f -mtime -6
./file4
./file200
Thanks.