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

Re: [OCLUG-Tech] Odd behaviour in find

> > > 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.

> 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.

replies