Hello, I am very new to scripting so you'll have to bear with me. Basically what I'm trying to do is take a directory and get the filename of the most recent file that starts with some prefix. So I have a directory with:
file_1495907432.bin
file_4324324342.bin
file_3424394322.bin
file_9099432443.bin
file_4787234109.bin
names.doc
names.pdf
from that list i would like to get the most recent file beginning with "file" and store the filename in a variable (var1).
so when i type
echo $var1
it gives the filename of the most recent file.
Any help would be awesome! I have searched a lot of pages and can't find anything.
Thanks in advance!