Re: Beginner's?? Question
On Mon, Nov 22, 2004 at 12:07:34PM +0200, David Baron wrote:
> All this gets me the current or previously accessed directory. I am
> trying to get the most recent file in a known directory. There are
> several log-type files in this directory, maybe several from
> today. I want to use the last-most recently altered file's name in a
> script.
Try this:
ls -ltr
This gives a listing of files in the current dir with the most
recently altered one last. To get only the name of that last one use:
ls -tr | tail -1
--
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands]
"Let your advance worrying become advance thinking and planning."
- Winston Churchill
Reply to: