I need to find out which directory was most recently created or modified in a directory and report it along with it’s date and time on a Solaris system to know when the last patch was applied to a system. Essentially it’s an ‘ls -lrt /var/sadm/patch | tail -1’. I’ve found a way of listing what’s under the top level folder (/var/sadm/patch), but I only want to know about the directories under there and whose the latest. Any help greatly appreciated.
name of (folders of folder “/var/sadm/patch”) whose (modification time of it = (maximum of (modification times of (folders of folder “/var/sadm/path”))))
You can also use “creation time” or “accessed time” instead of modification time.