System log files are serialized and I use ls -lrt to show me the most recent file. I then cat that file. This requires typing a long serial number each time.
How can I cat the last file appearing in my ls -lrt output in one command?
I'm using cygwin and the the output from ls -lrt foobar_job* look like this:
-
-rw-r--r-- 1 zundarz Domain Users 1133 Jul 31 16:54 foobar_job4855125.log
-rw-r--r-- 1 zundarz Domain Users 1256 Jul 31 17:10 foobar_job4855127.log
-rw-r--r-- 1 zundarz Domain Users 1389 Aug 11 10:20 foobar_job4887829.log
-rw-r--r-- 1 zundarz Domain Users 1228 Aug 11 10:39 foobar_job4887834.log
ls -lrt? The date format could be important. – Minix Aug 14 '15 at 20:20-lflag forls– Chris Davies Aug 14 '15 at 21:30