2

I noticed that some commands also come in with e- and f- versions, e.g. grep, egrep, fgrep and a few others.

Is there some pattern or a naming convention if a particular command should have e- or f-version?

  • 4
    What other commands have you seen with the same naming pattern? – Joseph R. Aug 29 '13 at 10:11
  • 2
    @JosephR. perhaps the OP is thinking of fsck and e2fsck? That's the only one I can think of that at least comes close. – terdon Aug 29 '13 at 11:14
7

There is a clue about this in, e.g., man grep, which is also man fgrep and man egrep -- very often tools with minor variations like this will have one man page for all the variations, explaining them in relation to one another:

In addition, two variant programs egrep and fgrep are available. egrep is the same as grep -E. fgrep is the same as grep -F. Direct invocation as either egrep or fgrep is deprecated, but is provided to allow historical applications that rely on them to run unmodified.

Presumably, fgrep and egrep were once standardized names, but if you look further down the man page note that -E and -F are "specified by POSIX", implying this standardization changed tack, but (as stated above), backward compatibility is maintained.

On the topic of whether programs 'should' have variants - no, there is no standard. But there are a lot of programs that do so thanks to the light-weight nature of links (see ln - ignore symbolic links).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.