![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File Modified : Alert me | StrengthThaDon | UNIX for Dummies Questions & Answers | 6 | 04-08-2008 03:23 PM |
| how to retrieve original contents of a modified file (modified using vi) | novice100 | UNIX for Dummies Questions & Answers | 3 | 05-31-2007 08:50 PM |
| who modified my file!! | mohanprabu | UNIX for Dummies Questions & Answers | 4 | 10-28-2005 10:18 PM |
| File last modified | szzz | High Level Programming | 4 | 11-05-2003 11:44 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I'm presuming there are no subdirectories. It becomes difficult with large numbers of files because you need to use multiple ls commands, therefore you can no longer use its built-in sort-by-time capability. Instead you have to it yourself. This is a little easier if you can be sure that you are only interested in files that were modified in the last 12 months, so you can ignore files whose dates contain a year, e.g.
Code:
find dir1 dir2 -type f | xargs ls -l | awk '$8 ~ /:/' | sort -k 6,6M -k 7,7n | tail -1 | awk '{print $NF}'
Last edited by Annihilannic; 07-16-2008 at 04:23 AM.. Reason: forgot the tail bit |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|