finding new files
Hi...when multiple subdirectories are under a main directory, how can I find only new files i.e from last 1 are two days modified or new files . Hope someone will definetely help this.
Regards Niharika |
Quote:
|
finding new files
As you said I did as "find /home/my_home_dir -mtime +1 -print", But it is giving around 1442 files information which is also included .Mozilla, .thunderbird, .thumbnail, .metacity files, I don't want these files info. So how can I exculde these hidden directories info, And what does +1 means in this command? Is it since last one day?
Quote:
|
kirukan, "-print" is not necessary.
|
How to exclude hidden entries and +1 meaning
Quote:
Code:
find ./* -mtime +1 The +n means the files are at least n*24 hours old: with n=1, it's at least (more than) 24 hours old, or at least 2 days old. Is that what you want? |
Yes Mr. Alex,
Please refer the following thread http://www.linuxquestions.org/questi...olders-208169/ |
Only excluding 1st-level hidden entries
Note that the solution I mentioned only excludes the 1st-level entries, meaning the hidden directories and files in the main search directory won't be included.
So to exclude ".mozilla", ".metacity" and so forth, you use what I wrote before: Code:
find ./* -mtime +1 However, if you have hidden entries INSIDE the non-hidden, 1st-level entries, they will still be listed. To exclude hidden matches (if you don't want hidden files to be shown in your search query), you can additionally use the -not -name modifier: Code:
find ./* -not -name ".*" -mtime +1 |
finding new files
Yes you are correct, But now if I used "find ./* -mtime +1", But it is showing all old files older than a day, but excuding hidden directories.
But I need new files of last one or two days. So I ran "-1" instead of "+1" & found only new files which are belongs to since last 24 hours. Anyway Thank you very much for your kind help. Quote:
|
finding new files
Hey..Thank you very much for giving this useful link.
Quote:
|
Can use -2 for at most 2 days
Quote:
Code:
find ./* -mtime -2 |
All times are GMT -5. The time now is 12:04 AM. |