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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.