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
Admin blog with fixes to few of the issues faced.
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