![]() |
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 |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to find the latest file on Unix or Linux | duke0001 | UNIX for Dummies Questions & Answers | 10 | 11-04-2008 04:31 AM |
| Shell script to ftp latest file | im_new | Shell Programming and Scripting | 7 | 11-23-2007 01:15 AM |
| finding latest file having timestamp on it..... | kaushik25 | Shell Programming and Scripting | 1 | 08-06-2007 10:35 PM |
| How to find whenther given value is in betwwen min and Max in unix shell scripting | pinky | UNIX for Dummies Questions & Answers | 5 | 07-27-2007 10:52 AM |
| Find and remove all but the latest file | hyennah | Shell Programming and Scripting | 4 | 03-28-2007 11:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi guys,
I have a directory in UNIX having files with the below format, i need to pickup the latest file having recent timestamp embedded on it, then need to rename it to a standard file name. Below is the file format: filename_yyyymmdd.csv, i need to pick the latest and move it with the standard file name. Please help. regards, sundar |
|
||||
|
One way:
Code:
now=`date +%Y%m` ls -rt filename_"$now"*.csv | tail | read file cp $file standard_file_name |
|
|||||
|
Please, do not duplicate posts:
http://www.unix.com/shell-programmin...amp-on-it.html |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|