1834650 Members
1936 Online
110069 Solutions
New Discussion

list files > 1 years

 
SOLVED
Go to solution
Lee Huei
Regular Advisor

list files > 1 years

hi,

any comamnd to list files created more tahn 1 years ?

thks
8 REPLIES 8
Bharat Katkar
Honored Contributor
Solution

Re: list files > 1 years

Hi,

# find ./ -name -print | xargs ls -al | grep "2003"

Hope that works to your satifaction.

Regards,

You need to know a lot to actually know how little you know
Mei Jiao
Respected Contributor

Re: list files > 1 years

Yes, try this:
# find -mtime 356
Lee Huei
Regular Advisor

Re: list files > 1 years

hi,

how can i include ll into the command below ?

# find / -atime +20
# find / -atime +20 | xargs ls -l <<== this list out all fiels under the directory which is not desired

and how can i find the access date of a particular files ??

thks
john korterman
Honored Contributor

Re: list files > 1 years

Hi,

you can try this to include ls -l functionality:
# find / -mtime +20 -exec ls -l {} \;
and use a not-operator for the "opposite":
# find / ! -mtime +20 -exec ls -l {} \;
Tehre are spaces on either sides of !

regards,
John K.
it would be nice if you always got a second chance
Lee Huei
Regular Advisor

Re: list files > 1 years

Hi John,

No, the command is not the correct one.It lists out all files not only those being modified > 20 days



i need something like this:
# cd /tmp
# find ./* -mtime -1 | xargs ls -l
-rwxrwxrwt 1 root sys 7 Nov 2 15:35 ./test <=== this is the only file under /tmp that is last modified which is less than 1 day


Thanks.
john korterman
Honored Contributor

Re: list files > 1 years

Hi,
hmmm....
then try first to make a reference file which is one day old..., e.g.:
# date
Tir. 2 Nov. 2004 09:05
now then make a reference file from "yesterday":
# touch 1101000004 ./ref_file
# ls -l ./ref_file
-rw-r--r-- 1 jxk users 0 Nov 1 00:00 ./ref_file

and list the files whose last change is newer than the reference file, e.g.:
# find . -type f -newer ./ref_file -exec ls -l {} \;

is that what you want?

regards,
John K.
it would be nice if you always got a second chance
Lee Huei
Regular Advisor

Re: list files > 1 years

Hi John,


I want to have something such as below:

i have 3 files underneath /tmp as shwon below:
-rw-rw-rw- 1 root sys 0 Nov 2 16:33 abc
Oct 1 00:00 ref_file <<=== never been access since yesterday
-rw-r----- 1 root sys 441 Nov 2 16:33 sir.cfg


when i run
# cd /tmp
# find . -atime 1
--> why i still get teh list of ref_file ? it should not ?

when access means i read the file right ? the file date from ll remained as the last editted date right ?

thks
john korterman
Honored Contributor

Re: list files > 1 years

Hi again Mico,

# find . â mtime 1
lists files that are 1 day old (not 2 days, not 3 days, not 4 days etc). One day = 24 hours, i.e. less than 24 hours will be included as well.
Try this command, which will list those older than 24 hours:_
# find . â mtime +1

regards,
it would be nice if you always got a second chance