0

i would like to find files that have been modified during a month. lets say i am type in 2004 06
it will find files in the month of june.
i know using l -la lista all the files and thier attrbutes. and one of thier attributtes is last modified time. can i somehow search for files using the modified time attrbute of the file

is there also a way to convert a numberic date to a textual date e.g. like
06 2006 to jun 2006

need help urgently

thanks

3
Contributors
2
Replies
4
Views
11 Years
Discussion Span
Last Post by ranj@chn
0

make a file with name of the month and the month in numeral format.

Say,

Jan 01
Feb 02
March 03

store the year and month in two different variable.

grep the month from the file containing the month and the corresponding number.

use awk to print the month name and year.

Do a ls -Ral and grep the month and year.

Try this out. It works.

Amit

0

i would like to find files that have been modified during a month. lets say i am type in 2004 06
it will find files in the month of june.
i know using l -la lista all the files and thier attrbutes. and one of thier attributtes is last modified time. can i somehow search for files using the modified time attrbute of the file

is there also a way to convert a numberic date to a textual date e.g. like
06 2006 to jun 2006

need help urgently

thanks

You can use 'case' function to name the month parameter like
LEts suppose inside the script
$1-06
$2 - 2006
case $1 in
01)) month="Jan" ; break;;
02)) month="Feb" ; break;;
.
.
.
.
.
and then grep for the 'month' and year variable from the ls output.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.