[SOLVED] How to find the directory with latest modified content??
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Thanks for all your inputs.
based on GrapefruiTgirl's script, I found a simple workaround for my problem.
find . -type f | xargs ls -rtl
The above command lists all files in all nested sub-directories with timed order (latest modified file being at end of list).
Based on the command output, we can see what is latest modified file which tells us the directory path also.
I think this solution works fine. what say?
(but still this command is not sorting files in order in some cases where the time format changes. ex: very old files are displayed with time like "Aug 30 2009" and for this year files "Aug 30 01:25")
I dunno, something's amiss. When I try your latest command, and grail's command, and my script, I get three different results, and grail's method looks to be the (most?) correct result. I'd do some more examining of your output if I were you.
It's fairly obvious that the script I provided is way too convoluted to work with, when compared to the possible alternates, so have a closer look at your results from the other methods..