I have a bash script that saves a date (of last change), filename, maybe number of changes etc in a file (something similar to ls
output).
Is there any way to search in this file in bash, eg. get the most used file or the most recent file, but just the filename?
So the file looks something like this:
2018-03-28 19:47:41 filename1
2018-03-28 19:49:24 filename2
2018-03-28 19:50:14 filename1
2018-03-28 19:50:17 filename3
Now I would like to get the file that was used last, so I shall sort it (it's actually sorted already), but I only want to get the filename of the file last edited (with the latest date). Is there a way to do this apart from regex?