I have a logs/
directory which contains many log files. I would like to open the latest log file. My env is Ubuntu 16.
I know the name of the latest file. But the file is in logs/
dir. In such a case, how do I tell the relative pass via xargs
?
$ ls -t logs/ | head -1
20180615-184233.log
$ ls -t logs/ | head -1 | xargs less
failed