Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to find last two files for a month? Post 302896975 by Makarand Dodmis on Thursday 10th of April 2014 10:35:48 AM
Old 04-10-2014
Thanks a lot Srini & Rudic
Actualy i want all files other than last two files per month.
can it be posibble?
Code:
-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 user  userg         1596 Mar 24 15:43 h.txt
-rwxr-xr-x   1 user  userg         1596 Mar 25 15:43 w.txt
-rwxr-xr-x   1 user  userg         1596 Feb 12 15:43 q.txt
-rwxr-xr-x   1 user  userg         1596 Feb 21 15:43 a.txt
-rwxr-xr-x   1 user  userg         1596 Feb 22 15:43 s.txt
-rwxr-xr-x   1 user  userg         1596 Feb 23 15:43 k.txt
-rwxr-xr-x   1 user  userg         1596 Feb 27 15:43 j.txt

output should be:

Code:
c.txtd.txtf.txtq.txta.txts.txt

---------- Post updated at 09:35 AM ---------- Previous update was at 09:32 AM ----------

Code:
-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 user  userg         1596 Mar 24 15:43 h.txt
-rwxr-xr-x   1 user  userg         1596 Mar 25 15:43 w.txt
-rwxr-xr-x   1 user  userg         1596 Feb 12 15:43 q.txt
-rwxr-xr-x   1 user  userg         1596 Feb 21 15:43 a.txt
-rwxr-xr-x   1 user  userg         1596 Feb 22 15:43 s.txt
-rwxr-xr-x   1 user  userg         1596 Feb 23 15:43 k.txt
-rwxr-xr-x   1 user  userg         1596 Feb 27 15:43 j.txt

output should be:

Code:
For Marc.txtd.txtf.txtfor Febq.txta.txts.txt

Last edited by vbe; 04-10-2014 at 01:41 PM.. Reason: trying to sort the code (tags?)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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! (13 Replies)
Discussion started by: maldini
13 Replies

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

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

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

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

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

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

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

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

10. 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
strclean(1M)															      strclean(1M)

NAME
strclean - remove outdated STREAMS error log files SYNOPSIS
logdir] age] DESCRIPTION
cleans the STREAMS error logger directory of log files mm-dd) that contain error messages sent by the STREAMS log driver, strlog(7). If the option is not used to specify another directory, removes error log files in the directory. If the option is not used to specify another age, removes error log files that have not been modified in three days. Options recognizes the following options and command-line arguments: Specifies a directory for the location of the STREAMS error log files to be removed if this is not the default directory Specifies a maximum age in days for the STREAMS error log files if this not the default age of 3. The value of age must be an integer greater than or less than 3. EXAMPLES
Remove day-old error log files from a directory called FILES
One or more error log file or files on which operates. The mm-dd in the filename indicates the month and day of the messages con- tained in the file. NLS catalog for SEE ALSO
strerr(1M), strlog(7). strclean(1M)
All times are GMT -4. The time now is 11:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy