Give me the most current file

I needed a quick way to maintain a current symlink to the most recent file by time stamp. Here’s one way to do it:

ls -t1 *.jpg | head -1 | xargs -i ln -sf {} current.jpg

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *