|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
copy rename file in shell script
I have a series of log files each named by the date they were created.
I need to run a shell script that copies the latest file and renames it. |
|
#2
|
|||
|
|||
|
assuming that no logfile was tampered with, i.e. they have the creation / modification date that corresponds to their names... untested, but should this work:
mv `ls --sort=date|head -1` newfilename
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > copy rename file in shell script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|