cp files that have a particular datestamp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cp files that have a particular datestamp
# 1  
Old 04-18-2005
cp files that have a particular datestamp

Hello all

I'm trying to copy all files in the current directory with yesterday's date to another directory using a single command . I searched the faqs but all the examples listed out involve only the find command.I tried to do something like but it does'nt seem to work.

cp < ls -l |grep "Apr 14" > /usr/users/backup_dir

Thanks
# 2  
Old 04-18-2005
in the directory the files are located ...

cp -p `ls -l | awk '/Apr 14/ {print $NF}'` /usr/users/backup_dir
# 3  
Old 04-18-2005
cp files that have a particular datestamp

awesome ....Thanks Just Ice ! I need to start looking at AWK commands ....
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies

2. Shell Programming and Scripting

Datestamp format 2nd change in csv file (awk or sed)

I have a csv file formatted like this: 2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances. I have got this: awk -F, 'NR <=1 {print;next}{"date +%d/%m/%Y\" \"%H:%m -d\""$1 "\""| getline dte;$1=dte}1' OFS="," test.csvThis... (6 Replies)
Discussion started by: say170
6 Replies

3. UNIX for Dummies Questions & Answers

Comparing two files with datestamp to current date

Hi, I am new to unix and I am stuck on how to compare two .zip file with date stamp in my directory. I need to compare out of the two file which is oldest to current date and unzip it after that done continue to unzip the second zip file. Thanks for your help. (5 Replies)
Discussion started by: lilvi3tboix1
5 Replies

4. Shell Programming and Scripting

parsing a file of datestamp

i have a file which consists of the timestamp fields in the format first packet: Sat Mar 5 16:14:33.678747 2011 first packet: Sat Mar 5 16:14:34.035362 2011 first packet: Sat Mar 5 16:14:39.805442 2011 first packet: Sat Mar 5 16:14:43.934197 2011 first packet: ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

5. Shell Programming and Scripting

move datestamp to beginning of line where available

My current output is as follows: All Day Event Someone's Birthday Class 7:00 PM Pick up dry cleaning 1:00 PM Wake up 8:00 AM I'd like the output to remain the same but have the times moved to the beginning of the line with a hyphen after it so it would look like, All Day Event... (3 Replies)
Discussion started by: chrish
3 Replies

6. Shell Programming and Scripting

search files and copy them to a directory with datestamp attacched to it

Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it. Iam using following command to search the files find $CA_OUT_PATH/*/ftp_out -type f -mtime -1 but now how to copy these files to some other directory one by one ... (1 Reply)
Discussion started by: sreenusola
1 Replies

7. UNIX for Dummies Questions & Answers

search files and copy them to a directory with datestamp attached to it

Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it. Iam using following command to search the files find $CA_OUT_PATH/*/ftp_out -type f -mtime -1 but now how to copy these files to some other directory one by one with... (1 Reply)
Discussion started by: sreenusola
1 Replies

8. UNIX for Dummies Questions & Answers

unsure if this is a unix datestamp??? can you guys tell?

hi everyone im new here and im hoping you could help me out here. Yesterday i removed a time stamp from a program that i am using.This timestamp should contain a date of 04/04/2008 with a time sometime in that day. the stamp in hex is 7C FE 2B 04 DA 4E E3 40 ive looked everywhere and im... (1 Reply)
Discussion started by: uselessprog
1 Replies

9. Shell Programming and Scripting

simple help in datestamp

i have a problem here TZ=`date +%Z`+0 ;a=`date +%b%e`----gives me Feb27 but i want Feb 27.there should be a single space b/w Feb and 27.... can anyone tell me how to resolve this issues........ (1 Reply)
Discussion started by: ali560045
1 Replies

10. Shell Programming and Scripting

Substring/Instring of a string with datestamp

Hi, I have just started working on unix today. I want to get the instring of a string (filename). Eg. JAN_BILS_PRINT_01-01-08.txt Now i want to extract the datestamp from the file and convert the date to the format mm/dd/yyyy. How do i do this? Please hel pme with this. Regards,... (10 Replies)
Discussion started by: bhalotias
10 Replies
Login or Register to Ask a Question