Welcome to the Linux Foundation Forum!

User Guide confusion

tw3ak
tw3ak Posts: 37

nEWb here,

I've gotten through one user's guide that was useless. I've found a rather good one that I can understand.

As an exercise of the book I'm going thru man pages and I'm in "find" this is part of the man explanation :find -size [[+|-[[

I understand that <> anything there is replaced with what is needed to operate, also that the square brackets normally do the same however they have brackets inside brackets? I think I understand the + and - what they are looking for but why the "pipe"?

Comments

  • CCC
    CCC Posts: 12
    "|", in this context, means "or" (not "pipe"). That is, [+|-] means "optional plus or minus".

    As an example, the "man grep" page includes [-e PATTERN | -f FILE] - which means I can use grep -e with a pattern, or grep -f with a file, but I can't use -e and -f at the same time.

    Nested brackets are allowed; for example, in the man gcc page (a bit of a long one to read through, and probably only of interest if you plan to be writing software in the very near future, but it's the first example I found), I see the following (among other options): [-Dmacro[=defn]...]; that means that I can use -Dmacro if I want, and if I do so I have the option of adding a definition to the end of the command after an equals sign (but I can't do that without the -Dmacro).

Categories

Upcoming Training