Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i rename a file and include the date and time as exensions 1

Status
Not open for further replies.

helentps

MIS
Feb 8, 2005
3
US
I have a script to rename particular files in my system and currently the script puts a program id number at the end of the file name and i'd like to put the date and time instead. So instead of my file being something like 1234.asc.58500 i'd like it to be 1234.asc.20050320.135400
What command can i use to accomplis that?? Currently I am using:
rn 1234.asc 1234.asc$$

thanks for your help!!
 
man date to find the correct syntax but it would be something like:

1234.asc.$(date +%y%m%d).$(date +%T)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top