Originally posted by: aravinthsamy
Some commands to grep different dates of the month
ls -ltr | grep "Jan 2
0-7" -----to list the files from jan20 to jan27
ls -ltr | egrep "Oct (1
0-7|2
0-2|25)" ----------To list the files from 10-17, 20-22, and 25th of Oct month
ls -ltr | egrep "((Oct|Dec) (1
0-7|2
0-7))"--------To list the files of both month Oct and Dec from 10th to 17th and 20th to 27th
ls -ltr | egrep "((Oct|Dec) (1
0-7|2
0-2|25))" --------To list the files of both month Oct and Dec from (10th to 17th) and (20th to 22nd) and 25th
ls -ltr | egrep "((Oct|Dec) (10|20|26|28))" -----------To list the files of both month Oct and Dec grepping date of 10th,20th,26th,28th
ls -ltr | egrep "((Sep|Oct|Dec) (10|20|26|28))" -----------To list for 3 months similarly like above
ls -ltr | egrep "(Oct (1
0-7|2
0-2|25)| Dec (1
2-5|2
3-6|29))"--------To list the files of (Oct 10-17,20-22,25) and (Dec 12-15,23-26,29)
#AIX-Forum