home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Odd behaviour in find

On 11/25/2015 03:58 PM, Alex Pilon wrote:
>>>> On 15-11-25 01:39 PM, Alex Pilon wrote:
>>>>> Is it just me or should this work?
>>
> On Wed, Nov 25, 2015 at 03:45:38PM -0500, Peter Sjöberg wrote:
>> It's just you who skipped reading the man page
> 
> No. I did read the man page. It's not doing what it's supposed to.
> 
>>>     $ find -- sadasdasdasd
>>>     find: `sadasdasdasd': No such file or directory
>>
>> "find" - command
>> "--" - remaining arguments aren't options
>> "sadasdasdasd" - directory to search in and assuming you don't have a
>> directory named "sadasdasdasd" it's all expected
> 
> Exactly. That one works, but the other ones don't.
> 
What I read was that you where surprised that it gave an error, guess I
misunderstood your initial question
>> to search for it in current (".") directory.
>> To find files  over 10M in /var you can
>>    find /var -size +10M -ls
>> To find logfiles older than 365 days you can
>>    find /var/log -type f -name "*.log" -mtime +365 -ls
> 
> Come on. I can read the man page!

> 
> I very well understand how to use man and find. I know what '--' is
> supposed to do. It's just that here…
> 
>> "--" - "A double dash -- can also be used to signal that any remaining
>> arguments are not options"
> 
> It just doesn't do what is expected.
> 
Well, the "--" part M.Webb explained so I'm not taking that again.
Guess that was what you really asked about, not that "find bla" didn't
find a file named "bla", sorry for that part (guess I been dealing to
much with indian "senior" linux people who doesn't know what a MAC
address is or the difference between resize2fs and mkfs!)

/ps