Find MSWord doc Files by Year and then Copy


 
Thread Tools Search this Thread
Operating Systems Linux Find MSWord doc Files by Year and then Copy
# 1  
Old 07-03-2012
Find MSWord doc Files by Year and then Copy

I need to be able to find all *.doc files by year last modified and then perform an action such as copy to folder: /documents/2011

the 'find' command seems to show the path but not the full file details, which includes the date modified as the ls command does.

I got this far with ls, but have not been able to perform an action on the results:

ls -l | grep '2011'
# 2  
Old 07-03-2012
# 3  
Old 07-05-2012
Thanks for the reply. Using the method suggested in the links, I was able to construct the following command, which works:
touch -t 201101310001 begin2011
touch -t 201112310001 end2011
find -type f -iname '*.doc' -newer begin2011 ! -newer end2011

From here, I was able to append any further action such as:
-exec cp {} /somelocation \;

While it works fine, it does seem rather involved, with three steps instead of one. Is it not possible to use the 'find' command to simply search for a year, a month or a particular date as one can with the 'ls' command?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find all files other than last two dates per month and year?

Hi All, lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt -rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt -rwxr-xr-x 1 user userg 1596 Mar 22 2012 c.txt -rwxr-xr-x 1 user userg 1596 Mar 24 2012 d.txt... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies

2. Shell Programming and Scripting

How to find all files other than first two dates & last date per month and year?

how to find all files other than first two dates & last date per month and year Hi All, lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt -rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt -rwxr-xr-x 1 user userg ... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies

3. Shell Programming and Scripting

How to find all files for same month and year?

Hi All, I find all files for same month and year lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 2012 c.txt -rwxr-xr-x 1 user userg 1596 Mar 21 2012 d.txt -rwxr-xr-x 1 user userg 1596 Mar 22 2012 f.txt -rwxr-xr-x 1... (8 Replies)
Discussion started by: Makarand Dodmis
8 Replies

4. Shell Programming and Scripting

Find and copy these files to particular directory

RedHat Enterprise Linux 5.4 I have some files with the extension .cdp in several directories in various mountpoints(filesystems) . I would like to find and copy all these files into a single directory /u03/diagnore/data. How can I do this ? (3 Replies)
Discussion started by: kraljic
3 Replies

5. Shell Programming and Scripting

How to find files and then copy them to another

I must write any shell script. I want find files which have .txt extension and then copy them to other, whithout this extension, for example: I found linux.out.txt file, and now it must be copy to new, linux.out. So: linux.out.txt -> linux.out ubuntu.config.txt -> ubuntu.config ... (4 Replies)
Discussion started by: piespluto
4 Replies

6. UNIX for Dummies Questions & Answers

How to find and copy files from one directory to another

Ok i have three directories Destination - /u/dir1 (has subdirectories dir2 which also has subdirectory dir3) Source1 - /u/test/files/dir1/dir2/dir3 Source2 - /u/out/images/dir1/dir2/dir3 What i would like to do is copy everything from Source1 and Source2 into the Destination directory.... (3 Replies)
Discussion started by: ziggy25
3 Replies

7. Shell Programming and Scripting

Editing MSWORD Doc

Hello, I need to know how to edit or set different fields in a MS-Word doc using perl. or altleast generate one. Thanks,:b: (1 Reply)
Discussion started by: rimser9
1 Replies

8. Shell Programming and Scripting

shell script to find and copy the files creted in the year 2006 to another directory

Hi All, I am new to UNIX. I will be thankful if some one helps me. I have to write a shell script for one of the requirement. I have files created from Jan 2006 to March 2008. My requirement is to write a script in such a way that 1) To find and copy(not Moving) the files created in the... (2 Replies)
Discussion started by: manas6
2 Replies

9. Shell Programming and Scripting

find files and copy into a directory

hi all, can u please help me in finding all ksh file in directory and including all subdirectories and then copy those files into another directory. thanks in advance -bali (4 Replies)
Discussion started by: balireddy_77
4 Replies

10. UNIX for Advanced & Expert Users

find files with a perticular year of access

Hello all, Might be a silly question, on my AIX machine the year had changed to 2022 and some files were accessed on this date hence the time stamp on these files is with year 2022, there are many such files. i want to list all these file from the root dir and subdir with 2022 year... (3 Replies)
Discussion started by: pradeepmacha
3 Replies
Login or Register to Ask a Question