LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   which files have modified in the last few days ? (https://www.linuxquestions.org/questions/mandriva-30/which-files-have-modified-in-the-last-few-days-535609/)

varun_saa 03-08-2007 01:23 AM

which files have modified in the last few days ?
 
Hello,

Iam on mandriva 2006.

How to find which files have been modified
in the last few days ?

Thanks

Varun

dannystaple 03-08-2007 01:33 AM

Quote:

Originally Posted by varun_saa
Hello,

Iam on mandriva 2006.

How to find which files have been modified
in the last few days ?

Thanks

Varun

In a single directory, ls -rlt will do it. I normally add the -h flag too so I get human formatted file sizes.

Cheers,
Danny

ygloo 03-08-2007 02:08 AM

hello,
you could use "find"
Code:

find dir -type f -ctime number_of_days

varun_saa 03-10-2007 04:44 AM

Thanks that was helpful.

Varun

dannystaple 03-10-2007 06:33 AM

Quote:

Originally Posted by ygloo
hello,
you could use "find"
Code:

find dir -type f -ctime number_of_days

Ygloos method has the advantage (I think) that it will recurse into subdirectories, which mine wont. My version will actually list all files in a directory, but it sorts them by date and time.

Danny

varun_saa 03-10-2007 07:46 AM

find dir -type f -ctime number_of_days

how do you specify ' -type '

Thanks again

Varun

Micro420 03-10-2007 10:34 AM

-type is an option

Example using find:
Code:

find /home -type f -ctime 5 -print
Find a regular file in /home that has been changed in the past 5 days and print out the full path results


All times are GMT -5. The time now is 07:13 AM.