I have a folder which consists files numbered 1, 2, 3, 4, 5 and so on. These files are named as numbers only. Along with these files, I also have two folders in the same directory.
Am trying to extract the last five files from the directory (excluding folders and also files without numbers) whose file name is a number. So am trying to do something like this:
ls /var/lib/myFolder/prog/TEST_DEV/builds/ -t | head -n5
But this returns files along with my two directories.
Then i tried something like:
ls /var/lib/myFolder/prog/TEST_DEV/builds/ -p | tail -5
Which doesn't work as well.
Any suggestions on how to proceed?