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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThere 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 asgrep -E
.fgrep
is the same asgrep -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).
fsck
ande2fsck
? That's the only one I can think of that at least comes close.