How to use watch to return latest picture file and open that picture?

I am trying to use the watch command to see the latest file. It is showing the file but how do I switch to the latest one when an even newer file is created?

The files are pictures so I am opening them with an image viewer

here's what I tried

watch -n 0.1 ls /home/titan/mnt

but it doesn't work because I just need one file and basically the lastest file and store that file name and open it with an image viewer.


It is not clear to me why you want to use the watch command. Also ls is not the best choice here for many reasons.

If all you want is to watch for when a new file is created in /home/titan/mnt and open that file in an image viewer, then install inotify-tools like so:

sudo apt install inotify-tools

and use it in a bash script like so:

#!/bin/bash
path_to_directory="/home/titan/mnt/"

inotifywait -m "$path_to_directory" -e create |
while IFS=' ' read path action file
    do
    # You can use other image viewers than eog if you want
    eog "$path$file" &
    done