The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare date from db2 table to yesterday's Unix system date sasaliasim Shell Programming and Scripting 9 3 Days Ago 08:37 PM
Perl: Extracting date from file name and comparing with current date MKNENI Shell Programming and Scripting 4 03-26-2008 01:01 PM
date issue-find prevoius date in a patricular format bsandeep_80 UNIX for Advanced & Expert Users 3 11-15-2007 05:42 PM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 04:15 AM
Specify a previous date as start date in shell script ritzwan0 Shell Programming and Scripting 2 09-25-2006 02:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-30-2007
Registered User
 

Join Date: May 2005
Posts: 192
a fiel name with date

Hi,
I want to create a file which will have a name like myfile ending with date and time.
I did :
touch myfile%date
or
touch myfile%date%

But does not work. How to do that ?
Many thanks before.
Reply With Quote
Forum Sponsor
  #2  
Old 07-30-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Quote:
Originally Posted by big123456 View Post
Hi,
I want to create a file which will have a name like myfile ending with date and time.
I did :
touch myfile%date
or
touch myfile%date%

But does not work. How to do that ?
Many thanks before.
Code:
touch "myfile$(date)"
Reply With Quote
  #3  
Old 07-30-2007
Registered User
 

Join Date: May 2005
Posts: 192
Ok, thank you. but the format is not good. I have :
myfile_Mon Jul 30 09:49:03 CEST 2007

how can I have only :
myfile_30_jul

Thanks again.
Reply With Quote
  #4  
Old 07-30-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Quote:
Originally Posted by big123456 View Post
Ok, thank you. but the format is not good. I have :
myfile_Mon Jul 30 09:49:03 CEST 2007

how can I have only :
myfile_30_jul

Thanks again.
Read the man pages of date.
Reply With Quote
  #5  
Old 07-30-2007
Registered User
 

Join Date: Jun 2006
Posts: 74
touch "myfile_$(date +%d_%b)"
Reply With Quote
  #6  
Old 07-30-2007
Registered User
 

Join Date: May 2005
Posts: 192
many thanks.
Reply With Quote
  #7  
Old 08-23-2007
Registered User
 

Join Date: Aug 2007
Posts: 7
Need Help

Hi guy`s

I dont know how to start a threat yet.
but anyway here goes my question?
I have this job that i perform monthly manualy
I have to clear out files about 80000 files a month

This is what i currently use manualy(which takes time)
find . -name '*.200707*' > 07files

#Create tar archive

tar cvf arch_spool_nokia_200707.tar -I 07files

#Delete files added to tar acrhive:

cat 07files | xargs rm

can anyone help me speed up this process or give me some more advice on using Unix as I`m a Newbie
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0