5

I am currently running this command:

find . \( -type d -name .git -prune \) -o -type f -name "*"` on my macos shell.

I found the command in a Stack Overflow thread for another problem. I do not understand what -o argument is for.

I have looked into find’s man page and searched the web but could not find what is the argument for.

1 Answer 1

4

That -o means “or”.

As explained in the find man page:

The POSIX standard specifies parentheses '(', ')', negation '!' and the 'and' and 'or' operators ( -a, -o).

So -o is “or” and -a is and. Simple as that!

And FWIW, this ExplainShell page breaks down the whole command (somewhat) clearly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .