The following example shows how to use ls -t to locate the most recent files within the /var/adm directory. sulog, messages, utmpx, wtmpx, utmp, and lastlog were created or edited most recently. This is verified using output from ls -l, which shows that these three files were created or edited in March, while the other files in /var/spool were created or edited earlier.
$ ls -t /var/adm sulog wtmpx wtmp messages.1 vold.log spellhist messages utmp sa messages.2 log aculog utmpx lastlog messages.0 messages.3 acct passwd $ ls -l /var/adm total 686 drwxr-xr-x 5 adm adm 512 Feb 13 16:20 acct -rw------- 1 uucp bin 0 Feb 13 16:04 aculog -r--r--r-- 1 root other 8456 Mar 27 10:34 lastlog drwxr-xr-x 2 adm adm 512 Feb 13 16:36 log -rw-r--r-- 1 root other 117376 Mar 27 13:11 messages -rw-r--r-- 1 root other 4620 Jan 30 08:30 messages.0 -rw-r--r-- 1 root other 11176 Jan 23 04:30 messages.1 -rw-r--r-- 1 root other 60 Jan 13 09:45 messages.2 -rw-r--r-- 1 root other 0 Jan 31 04:05 messages.3 drwxr-xr-x 2 adm adm 512 Feb 13 16:03 passwd drwxr-xr-x 2 adm sys 512 Mar 20 06:59 sa -rw-rw-rw- 1 bin bin 0 Feb 13 16:04 spellhist -rw------- 1 root root 1647 Mar 27 13:28 sulog -rw-r--r-- 1 root bin 504 Mar 27 10:34 utmp -rw-r--r-- 1 root bin 5208 Mar 27 10:34 utmpx -rw-rw-rw- 1 root root 500 Jan 11 14:40 vold.log -rw-rw-r-- 1 adm adm 14724 Mar 27 10:34 wtmp -rw-rw-r-- 1 adm adm 151404 Mar 27 10:34 wtmpx |