Find all files by month


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find all files by month
# 1  
Old 08-02-2005
Find all files by month

Hi,

I am trying to do achieving of files by months.

find /test -name \*.* -mtime +30
will give me the result of all modified files after 30 days.
But lets say i want to list all files that is modified in last months... what is the command to do it?
Thanks!
# 2  
Old 08-02-2005
another thing is can i search all files that is btw this date to another date? thanks!
# 3  
Old 08-02-2005
Something on the lines of this should work.

find /test -name '*.*' -newer oldfile ! -newer newfile

where oldfile has an old modified date and
newfile has a newer modified date compared to oldfile.

Vino
# 4  
Old 08-02-2005
thanks vino for the help.
that's definately a great help.
however is there any other option than specifiying the file name?
it is because i won't have the luxury to know the old file and new file name in the folder.

Last edited by maldini; 08-02-2005 at 04:45 AM..
# 5  
Old 08-02-2005
This might work. Havnt tried it tho'

find /test -name '*.*' -mtime +60 ! -mtime +30

Did I make a mistake in my thought process ?? Smilie

Vino
# 6  
Old 08-02-2005
thanks vino again for the reply.
your that script works.
however, it is still specifiying by number of days instead of month Smilie
# 7  
Old 08-02-2005
Quote:
Originally Posted by maldini
however, it is still specifiying by number of days instead of month Smilie
I am lost. What are you trying to achieve ? Find files between two dates or something else ?

Vino
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need last month files after 10th of every month

Hi, I need all file names in a folder which has date >= 10th of last month, Example : files in folder AUTO_F1_20140610.TXT BUTO_F1_20140616.TXT CUTO_F1_20140603.TXT FA_AUTO_06012014.TXT LA_AUTO_06112014.TXT MA_AUTO_06212014.TXT ZA_AUTO_06232014.TXT Output: AUTO_F1_20140610.TXT... (9 Replies)
Discussion started by: nani1984
9 Replies

2. 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

3. 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

4. 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

5. UNIX for Advanced & Expert Users

Find all files other than first two files dates & last file date for month

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies

6. UNIX for Advanced & Expert Users

How to find last two files for a month?

Hi All, I need to find last two files for the month. lets say there are following files in directory -rwxr-xr-x 1 user userg 1596 Mar 19 15:43 c.txt -rwxr-xr-x 1 user userg 1596 Mar 21 15:43 d.txt -rwxr-xr-x 1 user userg 1596 Mar 22 15:43 f.txt -rwxr-xr-x 1... (14 Replies)
Discussion started by: Makarand Dodmis
14 Replies

7. Shell Programming and Scripting

how can i find the third friday of each month?

Help please! I need to read the calendar and put the date of the third Friday of each month into a variable for comparison in an "if" statement. How would I do this? Thnx, leslie02 (10 Replies)
Discussion started by: leslie02
10 Replies

8. UNIX for Advanced & Expert Users

find files modified in a specific month

hello i need a way to list files modified in a specific month and move them to a specific directry , i mean somthing like : find . -modifiedtime "May" -print -exec /usr/bin/mv newdirectory thank u (1 Reply)
Discussion started by: omer_ome
1 Replies

9. Solaris

find files modified in a specific month

hello i need a way to list files modified in a specific month and move them to a specific directry , i mean somthing like : find . -modifiedtime "May" -print -exec /usr/bin/mv newdirectory thank u (1 Reply)
Discussion started by: omer_ome
1 Replies

10. HP-UX

find files modified in a specific month

hello i need a way to list files modified in a specific month and move them to a specific directry , i mean somthing like : find . -modifiedtime "May" -print -exec /usr/bin/mv newdirectory thank u (1 Reply)
Discussion started by: omer_ome
1 Replies
Login or Register to Ask a Question