Hello,
I try to select some files in a repertory using -newer .
if i use this kind of options it works fine :
find . -newer file_mark -print | less
BUT if i use the exec option , it doesn't work anymore :
find . -newer file_mark -exec ls -l {} \;
It print the entire directory not only the files newer than file_mark.
What i understand is that find take into account the ".." and "." entry.
So i add -maxdepth 1 and -mindepth 1 options :
find . -newer file_mark -maxdepth 1 -mindepth 1 -exec ls -l {} \;
It work fine but i don't understand why.
More work show that i need only -mindepth to have the correct files selected.
Can someone show me some information about the meening of maxdepth and mindepth ? I work in french, with gnu find and don't understand the information about -maxdepth and -mindepth within the man of find ?
I try to select some files in a repertory using -newer .
if i use this kind of options it works fine :
find . -newer file_mark -print | less
BUT if i use the exec option , it doesn't work anymore :
find . -newer file_mark -exec ls -l {} \;
It print the entire directory not only the files newer than file_mark.
What i understand is that find take into account the ".." and "." entry.
So i add -maxdepth 1 and -mindepth 1 options :
find . -newer file_mark -maxdepth 1 -mindepth 1 -exec ls -l {} \;
It work fine but i don't understand why.
More work show that i need only -mindepth to have the correct files selected.
Can someone show me some information about the meening of maxdepth and mindepth ? I work in french, with gnu find and don't understand the information about -maxdepth and -mindepth within the man of find ?