The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can i copy files by date last modifed range? geauxsaints UNIX for Advanced & Expert Users 4 05-25-2008 12:06 PM
To copy the files newer than specific date RAJESHKANNA SUN Solaris 3 08-07-2007 04:44 AM
How to copy a file according to the date Nayanajith Shell Programming and Scripting 1 06-21-2006 04:46 AM
copy files with date isingh786 HP-UX 1 03-10-2006 05:04 PM
ftp copy: preserve source file date stamp cassj UNIX for Dummies Questions & Answers 5 02-16-2005 06:38 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-09-2006
chris_ie chris_ie is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 2
Copy a file with name as date??

Hi I want to copy a file but append the date and time....how?

So copying the file file1.txt will have file1_20061009_0950.txt

I know the command :
date +"%Y%m%d_%H%M"

but how do i get this in the file name ?
cp file1.txt newDirectory/file1_?????????.txt

Thanx
  #2 (permalink)  
Old 10-09-2006
mona's Avatar
mona mona is offline
Registered User
  
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Did you try this


Code:
cp file1.txt newDirectory/file1_`date +"%Y%m%d_%H%M"`.txt

  #3 (permalink)  
Old 10-09-2006
chris_ie chris_ie is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 2
ahhhhhhhhhhh, i rem seeing something like that before:P

Thanks mate!!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0