BreezyChick89
BreezyChick89

Reputation: 1479

Why is the "find" command have options after path while others don't

find / -iname 'foo'

Most command line programs have the filename as the last arguments. Pretty much everything with a - or -- in front will be before anything not with a '-' in front. Is this standardized somewhere? Why is find different? Do you know any other programs that have expressions last?

Upvotes: 2

Views: 227

Answers (1)

Thilo
Thilo

Reputation: 262644

Those are not options, those are what find calls an "expression". There are options, too, and they go, in fact, in front of the path.

Checkout out the man page:

NAME
     find -- walk a file hierarchy

SYNOPSIS
     find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
     find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

Upvotes: 6

Related Questions