LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   diff file (https://www.linuxquestions.org/questions/linux-newbie-8/diff-file-656782/)

ust 07-19-2008 12:26 AM

diff file
 
I would like to compare files in a directory , but if I want to only compare the files that are created within 30 minutes , can advise what can i do ? thx

blackhole54 07-19-2008 05:44 AM

The find command can select files based on time with the -cmin, -amin and -mmin options. For example, if wanted to see all files in the current directory created in the last 30 minutes, you could:

Code:

find . -mmin -30
So I am guessing you want to combine this with the diff command in some way. But I can't figure out precisely what you are trying to do. If you can clarify this a bit I might be able to give you a more specific command sequence. Also note that you can add many other qualifers to the find command such as file type (regular, directory, etc), names (including wildcards), etc.

(For future reference, note that for periods measured in days rather than minutes you can use the -ctime, -atime, and -mtime options.)

matthewg42 07-19-2008 06:56 AM

ust, your original post is very vague.

Please explain what you want in more detail.

What sort of files are they - images, text, source code, application data files?

What sort of comparison do you want to do - just to see if files are different, or do you want to see what the differences are?

What if you have 10 files in the last 30 minutes - which files should you compare to which other files?


All times are GMT -5. The time now is 08:23 PM.