Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 2021 16:30:10 +0100
From:      Polytropon <freebsd@edvax.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Files in /usr/share/misc
Message-ID:  <20210124163010.4a8d45d1.freebsd@edvax.de>
In-Reply-To: <trinity-6b8b28fb-d7fe-4b6e-afe4-047335eb5e19-1611495340838@3c-app-gmx-bs28>
References:  <trinity-6b8b28fb-d7fe-4b6e-afe4-047335eb5e19-1611495340838@3c-app-gmx-bs28>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 24 Jan 2021 14:35:40 +0100, mj-mailinglist@gmx.de wrote:
> While browsing the filesystem, i found the folder /usr/share/misc
> and now i am curious, what kind of files and why they were put there.

The files in that directory (!) are files shared for applications
that belong to the FreeBSD operating system. Some of them even
have a manpage you can consult, for example "man ascii".

Just a few comments:



> The list on "13.0-ALPHA2 stable/13-f76393a63" looks like this:
> -r--r--r--  1 root  wheel     3170 Jan 24 09:18 ascii

ASCII character set.



> -r--r--r--  1 root  wheel     5265 Jun 25  2020 bc.library

Library for the arbitrary precision calculator, see "man bc".



> -r--r--r--  1 root  wheel    43643 Jan 24 09:18 bsd-family-tree

The BSD family tree. :-)



> drwxr-xr-x  2 root  wheel        2 Jun 25  2020 fonts

Fonts to be used by the console subsystem, if supplied by
the sysadmin; the preinstalled fonts at /usr/share/vt/fonts
(vt) and /usr/share/syscons/fonts (sc) are provided by FreeBSD.



> -r--r--r--  1 root  wheel  1177518 Jan 24 09:18 magic
> -r--r--r--  1 root  wheel  6653320 Jan 24 09:18 magic.mgc

File recognition magic, see "man file".



> -r--r--r--  1 root  wheel      582 Jan 24 09:18 operator

C language operator precedence.



> -r--r--r--  1 root  wheel  1246724 Jan 24 09:18 pci_vendors

Brand and model codes.



> -r--r--r--  1 root  wheel   212427 Jan 24 09:18 termcap
> -r--r--r--  1 root  wheel  1343488 Jan 24 09:18 termcap.db

Terminal capabilities database, see "man 5 termcap".



> There are
> - some more, some less technical "lookup" files, like:
> ascii, birthtoken, flowers, iso3166, iso639, latin1,...

Correct - there are programs that use them.



> - some FreeBSD project related files, like:
> bsd-family-tree.dot, committers-*.dot, organization.dot
> These would better be part of the documentation.

Maybe. Those files however are maintained directly within the
FreeBSD OS distribution. The switch to "base pkg" could move
them into some documentation package.



> - some configuration an scripting examples, like:
> init.ee, gprof.callg, gprof.flat,...
> IMHO better placed in .../examples

Not sure if they are examples or presets / defaults (in which
case they probably could be in a defaults/ subdirectory at some
other location).



> - development(?) related files, like:
> pci_vendors, scsi_modes, usb_hid_usages, usbdevs, windrv_stub.c
> I don't know if these files are used during build-/runtime

Maybe they are produced for reference by the release building
process, or consumed by it? Not sure. :-)



> - some files which are used during (build-?/)runtime:
> magic, magic.mgc, termcap, termcap.db
> Shouldn't these be in a more specific place? They are pretty static,
> so the "var" part in /var/db does not fit,
> but services.db is located there, too.

In the past, /etc/termcap was a real file, now it is a symlink
to that misc/ subdirectory. Maybe /usr/share/db would be a
possible location for "non-variable" databases?



> - is the fonts folder in base, or did some port create it? I'm not sure.

Whatever is _not_ in /usr/local belongs to the OS (minus a few
obvious exceptions). As mentioned, this directory is to be used
by the console subsystem if the sysadmin chose to install them,
but see "man 1 vidcontrol" that this is _not_ a default location
so the full path would have to be provided if the sysadmin wants
to use such a ("nonstandard") font.



> What is the history behind /usr/share/misc?

More or less, it's a place for miscellaneous files, those that
should not "pollute" /etc or /var/db, but somehow _have_ to
reside somewhere.

There are historical reasons, as you can see from some of the
headers, such as

	@(#)flowers     8.1 (Berkeley) 6/8/93

which makes the file almost 30 years old. :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210124163010.4a8d45d1.freebsd>