![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find and store files based on FileName and Modified Time | edisonantus | UNIX for Advanced & Expert Users | 2 | 02-19-2008 11:25 AM |
| find files modified in a specific month | omer_ome | UNIX for Advanced & Expert Users | 1 | 07-02-2006 06:43 AM |
| find files modified in a specific month | omer_ome | SUN Solaris | 1 | 07-02-2006 06:38 AM |
| find files modified in a specific month | omer_ome | HP-UX | 1 | 07-02-2006 06:36 AM |
| shell script to find files | naren_samba2005 | Shell Programming and Scripting | 2 | 10-21-2005 02:06 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all,
I need to find out the last 2 modified files in a folder.There is some way by which,we can check the timestamp and find out..??please help this is urgent. Thanks in Advance Anju |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
As simple as
Code:
ls -Atr | tail -2 |
|
#3
|
|||
|
|||
|
Dear Anju,
to get the timestamp of a file, try this, ls -l filename|awk '{print $6$7$8}' then the result will be in the format of MonDDYY here in the place of YY u'll get the time of the file creation if the file get created within 6 months. if the file got created before 6 months then in the place of YY value will be the year(2007 etc) Regards, Pankaj |
|
#4
|
|||
|
|||
|
try this also
ls -lt |head -2 Regards, Pankaj |
|||
| Google The UNIX and Linux Forums |