ChatGPT解决这个技术问题 Extra ChatGPT

What does "opt" mean (as in the "opt" directory)? Is it an abbreviation? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 years ago. Improve this question

What does "opt" mean (as in the "opt" directory)? I commonly see this directory in Unix systems with development tools inside.

Is it an abbreviation?

I always imagined it meant "optional" but it never made sense to me either... "optional" in what sense?
Why is this off topic?
It should've been posted on either Super User or the Unix Stack Exchange site -- it isn't really about programming.
FYI, Adobe Reader chooses /opt as its installation directory. (Which is what lead me to this thread.)
I've seen many people put their cross-compiling toolchains in /opt/. Is there some historical reason for this?

S
Stephen C

In the old days, "/opt" was used by UNIX vendors like AT&T, Sun, DEC and 3rd-party vendors to hold "Option" packages; i.e. packages that you might have paid extra money for. I don't recall seeing "/opt" on Berkeley BSD UNIX. They used "/usr/local" for stuff that you installed yourself.

But of course, the true "meaning" of the different directories has always been somewhat vague. That is arguably a good thing, because if these directories had precise (and rigidly enforced) meanings you'd end up with a proliferation of different directory names.

The Filesystem Hierarchy Standard says this about "/opt/*":

"/opt is reserved for the installation of add-on application software packages."

By contrast it says this about "/usr/local/*":

"The /usr/local hierarchy is for use by the system administrator when installing software locally."

These days, "/usr/local/*" is typically used for installing software that has been built locally, possibly after tweaking configuration options, etcetera.


D
Dan

It's usually describes as for optional add-on software packagessource, or anything that isn't part of the base system. Only some distributions use it, others simply use /usr/local.


J
Justin808

OPTional

It holds optional software and packages that you install that are not required for the system to run.


It's just a convention you could call it "smoopty" if you wanted to.
I'd be curious how this differs from /usr/lib (which often contains optional software packages)
@JonathanLeaders - It is a historical holdover ... from the days when UNIX was a couple of orders of magnitude smaller (4.1bsd came on a single 1600bpi tape) and didn't have a package manager, package repositories, security updates, etc.
So are you saying that if I download a program from the Internet called, 'Space Invaders v4', I can/should install it into the /opt/Space Invaders v4' folder?
@noel For those who want to: sudo ln -s /opt /smoopty
g
ghoti

Add-on software packages.

See http://www.pathname.com/fhs/2.2/fhs-3.12.html for details.

Also described at Wikipedia.

Its use dates back at least to the late 1980s, when it was a standard part of System V UNIX. These days, it's also seen in Linux, Solaris (which is SysV), OSX Cygwin, etc. Other BSD unixes (FreeBSD, NetBSD, etc) tend to follow other rules, so you don't usually see BSD systems with an /opt unless they're administered by someone who is more comfortable in other environments.


I recall seeing it in ultrix ... which could take it back to as early as 1984.
Thanks for that link. The larger question here is: What are the understood purposes of all the standard UNIX folders?, which your link answers excellently.
d
digidigo

It is an abbreviation for 'optional' , used for optional software in some distros.